/* ========================================================== */
/* -------------------- 1. GLOBAL & LAYOUT ------------------ */
/* ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #222222;
    background: linear-gradient(135deg, #dbe6d5 0%, #ffffff 50%, #fef8dc 100%);
    background-attachment: fixed;
}

.global-main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    width: 100%;
}

.global-main-container>div {
    width: 100%;
    max-width: 1200px;
}

.global-header {
    background-color: #1b5e20;
    color: #ffffff;
    padding: 20px 28px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    position: relative;
}

.global-header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.global-header-center {
    display: flex;
    align-items: center;
    gap: 15px;
}

.global-header-logo {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    object-fit: cover;
}

.global-header-text {
    text-align: center;
}

.global-header-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.global-header-subtitle {
    font-size: 1.50rem;
    opacity: 0.85;
    margin: 0;
}

.global-back-btn {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;

    align-items: center;
    gap: 8px;
    background: transparent;
    color: #ffffff;
    border: none;
    font-size: 1.15rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.global-back-btn:hover {
    opacity: 0.85;
}

.global-footer {
    background-color: #1b5e20;
    color: #ffffff;
    text-align: center;
    padding: 32px 20px;
    font-size: 1.25rem;
    opacity: 0.95;
    margin-top: auto;
}

/* =========================================
   Mobile Responsiveness (Media Queries)
   ========================================= */

@media (max-width: 768px) {
    .global-header {
        padding: 15px 20px;
    }

    .global-main-container {
        padding: 20px 15px;
    }

    .global-header-logo {
        width: 45px;
        height: 45px;
    }

    .global-header-title {
        font-size: 1rem;
    }

    .global-header-subtitle {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {

    .global-back-btn {
        font-size: 0;
        gap: 0;
        left: 15px;
    }

    .global-back-btn svg {
        width: 32px;
        height: 32px;
    }

    .global-header-center {
        gap: 10px;
        margin-left: 25px;
    }

    .global-header-logo {
        width: 35px;
        height: 35px;
    }

    .global-header-title {
        font-size: 0.95rem;
    }
}


/* ========================================================== */
/* ------------------ 2. HOMEPAGE SPECIFIC (hp-) ------------ */
/* ========================================================== */

.hp-hero-section {
    text-align: center;
    margin-bottom: 28px;
}

.hp-hero-title {
    font-size: 2.1rem;
    color: #111111;
    font-weight: 700;
    margin-bottom: 6px;
}

.hp-hero-subtitle {
    font-size: 1.5rem;
    color: #2e7d32;
    font-weight: 600;
    margin-bottom: 16px;
}

.hp-hero-description {
    max-width: 560px;
    margin: 0 auto;
    font-size: 1.25rem;
    color: #666666;
    line-height: 1.5;
}

.hp-cards-wrapper {
    display: flex;
    flex-direction: row;
    gap: 32px;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.hp-card {
    background: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    /* full border on all sides */
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    flex: 1 1 320px;
    min-width: 320px;
    max-width: 450px;
    text-align: center;
    display: flex;
    flex-direction: column;
}

/* Border color per card, applied to ALL sides instead of just left */
.hp-card.border-yellow {
    border: 1px solid var(--yellow);
}

.hp-card.border-emerald {
    border: 1px solid #22c55e;
}

@media (max-width: 940px) {
    .hp-cards-wrapper {
        flex-direction: column;
        align-items: center;
    }
}

.hp-icon-circle {
    width: 96px;
    height: 96px;
    background-color: #fdd835;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.hp-icon-circle svg {
    width: 28px;
    height: 28px;
    fill: #1b5e20;
}

.hp-card-title {
    font-size: 2.35rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #111111;
}

.hp-card-subtext {
    font-size: 1.40rem;
    color: #777777;
    margin-bottom: 20px;
    flex-grow: 1;
}

.hp-btn-submit {
    display: block;
    width: 100%;
    background-color: #1b5e20;
    color: #ffffff;
    border: none;
    padding: 12px;
    font-size: 1.50rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
    text-decoration: none;
    margin-top: auto;
    /* Secondary safety rule to lock button to the bottom */
}

.hp-btn-submit:hover {
    background-color: #144618;
}


/* ========================================================== */
/* ------------------ 3. REGISTER FORM SPECIFIC (reg-) ------ */
/* ========================================================== */

.reg-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 36px 40px;
    width: 100%;
    max-width: 850px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin: 0 auto;
}

.reg-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    text-align: left;
}

.reg-label {
    font-size: 1.50rem;
    font-weight: 600;
    color: #222222;
}

.reg-input,
.reg-select,
.reg-textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 1.25rem;
    background-color: #f3f4f6;
    color: #111111;
    outline: none;
    transition: border-color 0.15s, background-color 0.15s;
}

.reg-input:focus,
.reg-select:focus,
.reg-textarea:focus {
    border-color: #1b5e20;
    background-color: #ffffff;
}

.reg-textarea {
    resize: none;
}

.reg-btn-submit {
    display: block;
    width: 100%;
    background-color: #1b5e20;
    color: #ffffff;
    border: none;
    padding: 15px;
    font-size: 1.92rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
    text-decoration: none;
    margin-top: 28px;
}

.reg-btn-submit:hover {
    background-color: #144618;
}

.reg-bottom-title {
    text-align: center;
    font-size: 2.60rem;
    font-weight: 700;
    color: #111111;
    margin-top: 28px;
}

/* ========================================================== */
/* -------------- FORM ERROR & VALID STYLES ----------------- */
/* ========================================================== */

.reg-input.error,
.reg-select.error,
.reg-textarea.error {
    border: 1px solid #dc2626 !important;
    background-color: #fef2f2 !important;
}

.reg-input.valid,
.reg-select.valid,
.reg-textarea.valid {
    border: 1px solid #16a34a !important;
    background-color: #f0fdf4 !important;
}

.reg-alert-banner {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #991b1b;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.1);
    display: none;
}

/* ========================================================== */
/* ------------------ 4. FACE CAPTURE SPECIFIC ------- ------ */
/* ========================================================== */

.face-angle-steps {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.face-step-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background-color: #f3f4f6;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.face-step-item.active {
    border-color: #1b5e20;
    background-color: #e8f5e9;
}

.face-step-item.done {
    background-color: #dcfce7;
}

.face-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #1b5e20;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.face-step-lbl {
    font-size: 0.95rem;
    font-weight: 600;
    color: #222222;
}

.face-prompt-banner {
    background-color: #fef8dc;
    border: 1px solid #fde047;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1.15rem;
    color: #854d0e;
    text-align: center;
    margin-bottom: 18px;
    transition: all 0.3s ease;
}

.face-cam-box {
    position: relative;
    width: 100%;
    height: 380px;
    background-color: #0f172a;
    border-radius: 12px;
    border: 3px solid #1b5e20;
    overflow: hidden;
    margin-bottom: 20px;
}

.face-cam-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.face-overlay-guide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.face-oval-frame {
    width: 210px;
    height: 270px;
    border: 4px dashed #dc2626;
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.face-oval-frame.valid {
    border: 4px solid #16a34a !important;
    box-shadow: 0 0 25px rgba(22, 163, 74, 0.85), 0 0 0 9999px rgba(15, 23, 42, 0.55) !important;
    animation: oval-pulse-green 1.2s infinite alternate ease-in-out;
}

.face-oval-frame.invalid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.5), 0 0 0 9999px rgba(15, 23, 42, 0.55);
}

@keyframes oval-pulse-green {
    from {
        box-shadow: 0 0 15px rgba(22, 163, 74, 0.5), 0 0 0 9999px rgba(15, 23, 42, 0.55);
    }

    to {
        box-shadow: 0 0 35px rgba(22, 163, 74, 0.95), 0 0 0 9999px rgba(15, 23, 42, 0.55);
    }
}

.face-direction-arrow {
    position: absolute;
    bottom: 16px;
    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.face-thumb-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.face-thumb-box {
    height: 110px;
    background-color: #f3f4f6;
    border: 2px dashed #cccccc;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    position: relative;
    overflow: hidden;
}

.face-thumb-title {
    font-size: 0.85rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 4px;
    color: #111111;
}

.face-thumb-status {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 4px;
}

.face-thumb-status.captured {
    color: #16a34a;
}

.face-btn-submit {
    display: block;
    width: 100%;
    background-color: #1b5e20;
    color: #ffffff;
    border: none;
    padding: 18px 24px;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    margin-top: 15px;
}

.face-btn-submit:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.9;
}

.face-btn-submit.ready {
    background-color: #15803d;
    font-size: 1.25rem;
    padding: 18px;
}

.face-btn-reset {
    display: block;
    width: 100%;
    background: transparent;
    color: #dc2626;
    border: 1px solid #fca5a5;
    padding: 8px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
}

.face-btn-reset:hover {
    background-color: #fef2f2;
}


/* ========================================================== */
/* ------------------ 5. SUCCESS SPECIFIC (succ-) ----------- */
/* ========================================================== */

.succ-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 36px 40px;
    width: 100%;
    max-width: 850px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin: 0 auto;
}

.succ-icon-circle {
    width: 72px;
    height: 72px;
    background-color: #dcfce7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.succ-title {
    font-size: 2.60rem;
    font-weight: 700;
    color: #111111;
    text-align: center;
    margin-bottom: 20px;
}

.succ-yellow-box {
    background-color: #fffde6;
    border-radius: 12px;
    padding: 22px 20px;
    margin-bottom: 18px;
    text-align: left;
}

.succ-id-label {
    font-size: 1.50rem;
    color: #6b7280;
    text-align: center;
    margin-bottom: 2px;
}

.succ-id-num {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1b5e20;
    text-align: center;
    margin-bottom: 18px;
}

.succ-info-list {
    font-size: 1.50rem;
    color: #222222;
    line-height: 1.85;
}

.succ-info-list strong {
    color: #111111;
    font-weight: 600;
}

.succ-blue-box {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 1.32rem;
    color: #1e3a5f;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
    text-align: left;
    line-height: 1.4;
}

.succ-btn-submit {
    display: block;
    width: 100%;
    background-color: #1b5e20;
    color: #ffffff;
    border: none;
    padding: 12px;
    font-size: 1.92rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
    text-decoration: none;
}

.succ-btn-submit:hover {
    background-color: #144618;
}