:root {
    --primary: #ED6A22;
    --primary-dark: #D45A18;
    --primary-soft: #FFF1E9;
    --green: #1B8B3B;
    --green-dark: #146A2D;
    --text-dark: #333;
    --text-muted: #7a7a7a;
    --border: #E5E5E5;
    --radius: 28px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Poppins', 'Nunito', system-ui, -apple-system, Segoe UI, sans-serif;
    color: var(--text-dark);
    background: #fff;
}

.auth-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
    gap: 24px;
}

.auth-pane {
    position: relative;
    display: flex;
    flex-direction: column;
}

.auth-pane.illustration {
    background: var(--primary);
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.auth-pane.illustration img {
    max-width: 75%;
    max-height: 75%;
    object-fit: contain;
}

.brand-logo {
    position: absolute;
    top: 28px;
    right: 32px;
    width: 90px;
    height: auto;
}

.form-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.form-card {
    width: 100%;
    max-width: 380px;
}

.form-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 28px;
}

.form-title .ministry { color: var(--green); }
.form-title .accent { color: var(--primary); }

.field {
    margin-bottom: 16px;
    position: relative;
}

.field input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 14px 20px;
    font-size: 14px;
    color: var(--text-dark);
    background: #fff;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    font-family: inherit;
}

.field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(237,106,34,.12);
}

.field input::placeholder { color: #b5b5b5; }

.field.has-icon input { padding-right: 46px; }

.toggle-eye {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    cursor: pointer;
    color: #9a9a9a;
    padding: 4px;
    display: flex;
}

.row-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 4px 6px 0;
    margin-bottom: 22px;
}

.row-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.row-links .muted {
    color: var(--text-muted);
    font-weight: 500;
}

.row-links .muted:hover,
.row-links a:hover { text-decoration: underline; }

.btn {
    width: 100%;
    border: 0;
    border-radius: 30px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: var(--primary);
    transition: background .15s ease, transform .05s ease;
    font-family: inherit;
}

.btn:hover { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .7; cursor: not-allowed; }

.btn .spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: -2px;
    margin-right: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.footer-line {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.footer-line::before,
.footer-line::after {
    content: '';
    height: 1px;
    background: #d8d8d8;
    flex: 0 0 50px;
}

.bottom-login {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}
.bottom-login::before,
.bottom-login::after {
    content: '';
    height: 1px;
    background: #d8d8d8;
    flex: 0 0 50px;
}
.bottom-login a {
    color: var(--text-dark);
    text-decoration: underline;
    font-weight: 500;
}

.form-error {
    background: #fdecea;
    color: #b3261e;
    border: 1px solid #f5c2bd;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 14px;
    display: none;
}
.form-error.show { display: block; }

.view { display: none; }
.view.active { display: block; }

/* Popup */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 20px;
}
.modal-backdrop.show { display: flex; }

.modal {
    background: #fff;
    border-radius: 18px;
    width: 100%;
    max-width: 460px;
    padding: 40px 32px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.confetti span {
    position: absolute;
    width: 7px;
    height: 12px;
    opacity: .85;
    transform: rotate(20deg);
    border-radius: 1px;
}

.check-wrap {
    position: relative;
    width: 130px;
    height: 130px;
    margin: 0 auto 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.check-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #cfd9d2;
    box-shadow: inset 0 0 0 6px #fff;
}

.check-circle {
    width: 102px;
    height: 102px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #2bb14b, #146a2d 80%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(20,106,45,.35), inset 0 -6px 12px rgba(0,0,0,.18);
}

.check-circle svg {
    width: 56px;
    height: 56px;
    color: #fff;
    filter: drop-shadow(0 2px 1px rgba(0,0,0,.25));
}

.modal h3 {
    color: var(--green);
    font-size: 26px;
    margin: 0 0 10px;
    font-weight: 700;
}

.modal p {
    margin: 0 0 22px;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.btn-okay {
    background: var(--green-dark);
    border: 2px solid var(--primary);
    color: #fff;
    border-radius: 30px;
    padding: 12px 56px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.btn-okay:hover { background: #0e5022; }

/* Responsive */
@media (max-width: 880px) {
    .auth-shell { grid-template-columns: 1fr; padding: 16px; }
    .auth-pane.illustration { display: none; }
    .brand-logo { position: static; margin: 12px auto 0; display: block; }
    .form-wrap { padding: 16px; }
}
