/* EIRS Auth Pages — Login & Register (City Government of Bago) */

:root {
    --navy:       #0c2340;
    --navy-mid:   #1a3a5c;
    --green:      #1a6b3c;
    --green-dark: #145530;
    --gold:       #b8860b;
    --text:       #1f2937;
    --muted:      #5b6472;
    --border:     #d8dee6;
    --bg:         #f4f6f9;
    --white:      #ffffff;
    --max:        1180px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.auth-body {
    font-family: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Gov top bar */
.gov-topbar {
    background: var(--navy);
    color: rgba(255,255,255,.88);
    font-size: 0.78rem;
    border-bottom: 3px solid var(--gold);
}
.gov-topbar-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

/* Compact header */
.auth-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
}
.auth-header-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}
.auth-brand:hover { text-decoration: none; }
.auth-brand img { height: 44px; width: auto; }
.auth-brand-text strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
}
.auth-brand-text span {
    font-size: 0.78rem;
    color: var(--muted);
}
.auth-header-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--navy);
    text-decoration: none;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--white);
}
.auth-header-link:hover {
    background: var(--bg);
    text-decoration: none;
}

/* Main layout */
.auth-main {
    flex: 1;
    display: flex;
    max-width: var(--max);
    margin: 0 auto;
    width: 100%;
    padding: 32px 24px 48px;
    gap: 0;
    align-items: stretch;
}

.auth-panel {
    flex: 0 0 340px;
    background: var(--navy);
    color: var(--white);
    padding: 40px 32px;
    border-radius: 6px 0 0 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-panel .eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,.65);
    margin-bottom: 16px;
}
.auth-panel h1 {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 14px;
}
.auth-panel > p {
    font-size: 0.92rem;
    color: rgba(255,255,255,.8);
    margin-bottom: 24px;
    line-height: 1.65;
}
.auth-panel-logos {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}
.auth-panel-logos img {
    height: 48px;
    filter: brightness(0) invert(1);
    opacity: 0.92;
}
.auth-panel-logos .sep {
    width: 1px;
    height: 36px;
    background: rgba(255,255,255,.25);
}
.auth-perks {
    list-style: none;
}
.auth-perks li {
    font-size: 0.86rem;
    color: rgba(255,255,255,.88);
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,.1);
    padding-left: 20px;
    position: relative;
}
.auth-perks li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 16px;
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 2px;
}
.auth-perks li:last-child { border-bottom: none; }

.auth-form-wrap {
    flex: 1;
    background: var(--white);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 6px 6px 0;
    padding: 40px 36px;
    min-width: 0;
}
.auth-form-wrap.wide { max-width: none; }

.auth-box h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
}
.auth-box .sub {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 24px;
    line-height: 1.55;
}
.auth-box .sub a { font-weight: 600; }

/* Forms */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.form-group label .req { color: #b91c1c; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.92rem;
    color: var(--text);
    background: var(--white);
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(26,107,60,.12);
}
.form-group input[readonly] {
    background: #f1f4f8;
    color: var(--muted);
    cursor: default;
}
.input-wrap { position: relative; }
.input-wrap input { padding-right: 42px; }
.toggle-pw {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    user-select: none;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--bg);
}
.toggle-pw:hover { color: var(--navy); }

.hint { font-size: 0.78rem; color: var(--muted); margin-top: 4px; display: block; }
.pw-strength { height: 4px; background: #e8ecf1; border-radius: 2px; margin-top: 8px; overflow: hidden; }
.pw-bar { height: 100%; width: 0; border-radius: 2px; transition: width .3s, background .3s; }

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.86rem;
    color: var(--text);
    cursor: pointer;
    line-height: 1.5;
}
.checkbox-label input { margin-top: 3px; accent-color: var(--green); width: auto; }

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #b91c1c;
    border-radius: 4px;
    padding: 12px 14px;
    margin-bottom: 20px;
}
.alert-error p { color: #991b1b; font-size: 0.86rem; margin: 4px 0; }
.alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-left: 4px solid var(--green);
    border-radius: 4px;
    padding: 12px 14px;
    margin-bottom: 20px;
    color: #166534;
    font-size: 0.86rem;
}

.btn-submit {
    width: 100%;
    padding: 12px 20px;
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
    margin-top: 6px;
}
.btn-submit:hover { background: var(--green-dark); }

/* ID upload card */
.id-upload-card {
    background: #f0f6fc;
    border: 1px solid #c5d9f0;
    border-left: 4px solid var(--navy-mid);
    border-radius: 4px;
    padding: 20px 22px;
    margin-bottom: 22px;
}
.id-upload-card.verified {
    background: #ecfdf5;
    border-color: #86efac;
    border-left-color: var(--green);
}
.id-upload-card .card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
}
.id-upload-card .card-desc {
    font-size: 0.84rem;
    color: var(--muted);
    line-height: 1.55;
    margin-bottom: 16px;
}
.upload-field { position: relative; width: 100%; }
.id-upload-card .field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.dropzone {
    display: block;
    width: 100%;
    border: 2px dashed #b8c5d6;
    border-radius: 4px;
    background: var(--white);
    padding: 32px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--navy-mid);
    background: #f8fafc;
}
.dropzone.has-file {
    padding: 16px;
    border-style: solid;
    border-color: var(--green);
}
.dropzone-icon { font-size: 1.5rem; margin-bottom: 8px; color: var(--muted); }
.dropzone-icon svg { display: block; margin: 0 auto; color: var(--navy-mid); }
.dropzone-title { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.dropzone-hint { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }
.dropzone-preview {
    max-width: 100%;
    max-height: 150px;
    border-radius: 4px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.dropzone-filename { font-size: 0.82rem; color: var(--green); font-weight: 600; margin-top: 8px; }
.file-input-hidden {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    opacity: 0;
}
.verified-badge {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #166534;
    margin-top: 12px;
}
.id-upload-card.verified .verified-badge { display: flex; }
.scan-error {
    display: none;
    margin-top: 10px;
    padding: 10px 12px;
    background: #fef2f2;
    border-radius: 4px;
    font-size: 0.82rem;
    color: #991b1b;
}
.scan-error.visible { display: block; }

.form-section { display: none; }
.form-section.visible { display: block; animation: fadeIn .35s ease; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(12,35,64,.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: var(--white);
    border-radius: 6px;
    padding: 32px 28px;
    text-align: center;
    max-width: 380px;
    width: 100%;
    border: 1px solid var(--border);
    box-shadow: 0 16px 48px rgba(12,35,64,.2);
}
.modal-spinner {
    width: 44px; height: 44px;
    border: 3px solid #e8ecf1;
    border-top-color: var(--green);
    border-radius: 50%;
    margin: 0 auto 18px;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.modal-box h3 { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.modal-box p { font-size: 0.88rem; color: var(--muted); line-height: 1.5; }
.modal-icon-error {
    width: 48px; height: 48px;
    margin: 0 auto 14px;
    background: #fef2f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #b91c1c;
    font-weight: 700;
}
.modal-box.error-modal h3 { color: #b91c1c; }
.btn-modal-close {
    margin-top: 20px;
    width: 100%;
    padding: 11px;
    background: #b91c1c;
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.btn-modal-close:hover { background: #991b1b; }

/* Footer */
.auth-footer {
    background: var(--navy);
    color: rgba(255,255,255,.6);
    font-size: 0.8rem;
    text-align: center;
    padding: 14px 24px;
}

@media (max-width: 900px) {
    .auth-main { flex-direction: column; padding: 20px 16px 32px; }
    .auth-panel {
        flex: none;
        border-radius: 6px 6px 0 0;
        padding: 28px 24px;
    }
    .auth-form-wrap {
        border-left: 1px solid var(--border);
        border-radius: 0 0 6px 6px;
        padding: 28px 22px;
    }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .gov-topbar-inner,
    .auth-header-inner { padding-left: 14px; padding-right: 14px; }
    .auth-brand img { height: 36px; }
    .auth-panel,
    .auth-form-wrap { padding: 22px 16px; }
}
