/* ============================================================
   Kirinyaga County – Auth / Login CSS
   Professional, clean design system
   ============================================================ */

:root {
    --kc-green:       #006400;
    --kc-green-dark:  #004d00;
    --kc-green-hover: #005200;
    --kc-gold:        #d4a017;
    --text-primary:   #111827;
    --text-secondary: #6b7280;
    --text-muted:     #9ca3af;
    --border:         #e5e7eb;
    --border-focus:   #006400;
    --bg-page:        #f9fafb;
    --bg-card:        #ffffff;
    --bg-input:       #ffffff;
    --radius-sm:      6px;
    --radius:         8px;
    --radius-lg:      12px;
    --shadow-card:    0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --transition:     0.15s ease;
}

/* ── Reset & page ── */
*, *::before, *::after { box-sizing: border-box; }

.app_main-content {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-page);
    padding: 2rem 1rem;
}

/* ── Outer container ── */
.auth-page {
    width: 100%;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

/* ── Branding block (above card) ── */
.auth-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--kc-green);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--kc-green);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.875rem;
    overflow: hidden;
}

.auth-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-logo-initials {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .05em;
}

.auth-brand-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem;
    letter-spacing: .01em;
}

.auth-brand-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ── Card ── */
.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    padding: 2rem;
    overflow: hidden;
}

/* ── Tabs ── */
.auth-tabs {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px;
    margin-bottom: 1.5rem;
    background: var(--bg-page);
}

.auth-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}

.auth-tab svg {
    flex-shrink: 0;
}

.auth-tab:hover {
    color: var(--text-primary);
    background: rgba(0,0,0,.04);
}

.auth-tab.active {
    background: var(--bg-card);
    color: var(--kc-green);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* ── Headings inside card ── */
.auth-heading {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem;
}

.auth-subheading {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0 0 1.375rem;
}

/* ── Fields ── */
.field {
    margin-bottom: 1rem;
}

.field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
    flex-shrink: 0;
}

.field-input {
    width: 100%;
    padding: 0.5625rem 0.875rem 0.5625rem 2.375rem;
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.field-input::placeholder {
    color: var(--text-muted);
}

.field-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 100, 0, 0.1);
}

.field-input.is-invalid {
    border-color: #dc2626;
}

.field-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.field-wrap.has-suffix .field-input {
    padding-right: 2.5rem;
}

.field-suffix-btn {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: color var(--transition);
}

.field-suffix-btn:hover {
    color: var(--kc-green);
}

.field-error {
    display: block;
    font-size: 0.75rem;
    color: #dc2626;
    margin-top: 0.3rem;
}

/* Large OTP code input */
.otp-input {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5rem;
    text-align: center;
    padding-left: 2.375rem;
}

/* ── Remember + forgot row ── */
.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.375rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--kc-green);
    cursor: pointer;
    flex-shrink: 0;
}

.link-muted {
    font-size: 0.8125rem;
    color: var(--kc-green);
    text-decoration: none;
    font-weight: 500;
}

.link-muted:hover {
    text-decoration: underline;
}

/* ── Buttons ── */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6875rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: var(--kc-green);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
    letter-spacing: .01em;
}

.btn-primary:hover:not(:disabled) {
    background: var(--kc-green-hover);
}

.btn-primary:focus-visible {
    outline: 3px solid var(--kc-gold);
    outline-offset: 2px;
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.5625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition);
}

.btn-ghost:hover {
    border-color: #9ca3af;
    color: var(--text-primary);
}

/* ── Alerts ── */
.kc-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6875rem 0.875rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    margin-bottom: 1rem;
    border-left: 3px dashed;
}

.kc-alert.error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #dc2626;
}

.kc-alert.success {
    background: #f0fdf4;
    color: #166534;
    border-color: #16a34a;
}

.kc-alert svg {
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── OTP sent notice ── */
.otp-sent-msg {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius);
    padding: 0.625rem 0.875rem;
    margin-bottom: 1rem;
}

/* ── Footer row below form ── */
.auth-footer-row {
    margin-top: 1.25rem;
    padding-top: 1.125rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-footer-row a {
    color: var(--kc-green);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer-row a:hover {
    text-decoration: underline;
}

/* ── Bottom meta (help / social / copyright) ── */
.auth-bottom {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.auth-bottom p {
    margin: 0 0 0.375rem;
}

.auth-bottom a {
    color: var(--text-secondary);
    text-decoration: none;
}

.auth-bottom a:hover {
    color: var(--kc-green);
}

.auth-social {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.auth-social a {
    color: var(--text-muted);
    transition: color var(--transition);
}

.auth-social a:hover {
    color: var(--kc-green);
}

.auth-copy {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem !important;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem 1.25rem;
        border-radius: var(--radius);
    }
    .auth-tabs {
        font-size: 0.75rem;
    }
}
