/* ============================================================================
   ACCOUNT PAGES STYLES  (Login / Register / Forgot Password / Confirm Email)
   Matjhabeng Municipality · CCMS
   ----------------------------------------------------------------------------
   Single source of truth. All design tokens live under the .account-page scope
   so they cannot leak into the rest of the portal.
   ============================================================================ */


/* ============================================================================
   1. DESIGN TOKENS
   ============================================================================ */
.account-page {
    --acc-primary: #1a7a2e;
    --acc-primary-dark: #0d5c1e;
    --acc-primary-light: #4caf50;
    --acc-gold: #ffc107;
    --acc-gold-dark: #f9a825;
    --acc-gold-light: #ffd54f;
    --acc-text: #1a1a1a;
    --acc-muted: #6c757d;
    --acc-border: #e8ece8;
    --acc-bg: #fafcfa;
    --acc-danger: #dc3545;
    --acc-danger-dark: #b02a37;
    --acc-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.15);
    --acc-radius: 16px;
    --acc-radius-sm: 12px;
    --acc-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ============================================================================
   2. PAGE BACKGROUND
   ============================================================================ */
.account-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f4f0 0%, #e8f0e8 50%, #dce8dc 100%);
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

    .account-page::before {
        content: '';
        position: absolute;
        top: -30%;
        right: -20%;
        width: 60%;
        height: 150%;
        background: radial-gradient(ellipse, rgba(26, 122, 46, 0.05) 0%, transparent 70%);
        pointer-events: none;
    }

    .account-page::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--acc-gold), var(--acc-gold-light), var(--acc-gold-dark), var(--acc-gold));
        opacity: 0.35;
    }


/* ============================================================================
   3. CARD SHELL
   ============================================================================ */
.account-card {
    background: #fff;
    border-radius: var(--acc-radius);
    box-shadow: var(--acc-shadow-lg);
    overflow: hidden;
    max-width: 440px;
    width: 100%;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: var(--acc-transition);
    animation: accFadeInUp 0.6s ease;
}

    .account-card:hover {
        box-shadow: 0 14px 60px rgba(0, 0, 0, 0.2);
        transform: translateY(-4px);
    }

.account-card-wide {
    max-width: 560px;
}


/* ============================================================================
   4. CARD HEADER
   ============================================================================ */
.account-card .card-header-custom {
    background: linear-gradient(135deg, #0d5c1e 0%, #1a7a2e 50%, #2e9e4a 100%);
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

    .account-card .card-header-custom::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -30%;
        width: 80%;
        height: 200%;
        background: radial-gradient(ellipse, rgba(255, 193, 7, 0.08) 0%, transparent 70%);
        pointer-events: none;
    }

    .account-card .card-header-custom .logo-wrapper {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 50%;
        padding: 8px;
        border: 3px solid var(--acc-gold);
        box-shadow: 0 0 30px rgba(255, 193, 7, 0.25);
        margin: 0 auto 0.75rem;
        width: 80px;
        height: 80px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 2;
        color: var(--acc-primary);
        font-size: 2rem;
        animation: accFloatLogo 3s ease-in-out infinite;
    }

        .account-card .card-header-custom .logo-wrapper img {
            width: 60px;
            height: 60px;
            object-fit: contain;
            border-radius: 50%;
            display: block;
        }

    .account-card .card-header-custom .header-badge {
        display: inline-block;
        background: rgba(255, 193, 7, 0.15);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        border: 1px solid rgba(255, 193, 7, 0.25);
        border-radius: 50px;
        padding: 0.25rem 1rem;
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--acc-gold-light);
        margin-bottom: 0.6rem;
        position: relative;
        z-index: 2;
    }

    .account-card .card-header-custom h2 {
        color: #fff;
        font-weight: 700;
        font-size: 1.6rem;
        margin: 0;
        position: relative;
        z-index: 2;
        letter-spacing: -0.01em;
    }

        .account-card .card-header-custom h2 .highlight {
            color: var(--acc-gold);
        }

    .account-card .card-header-custom p {
        color: rgba(255, 255, 255, 0.75);
        font-size: 0.85rem;
        margin: 0.35rem 0 0;
        position: relative;
        z-index: 2;
    }

    .account-card .card-header-custom .header-divider {
        border: 0;
        height: 2px;
        background: linear-gradient(90deg, transparent, var(--acc-gold), transparent);
        opacity: 0.35;
        margin: 0.75rem auto 0;
        max-width: 80px;
    }


/* ============================================================================
   5. CARD BODY
   ============================================================================ */
.account-card .card-body-custom {
    padding: 2rem 2rem 1.75rem;
}


/* ============================================================================
   6. FORM FIELDS — FLOATING LABELS
   ----------------------------------------------------------------------------
   Markup order (required):
       <input class="form-control" placeholder=" " />
       <label class="form-label">…</label>
       <i class="bi field-icon"></i>
       <button class="field-icon field-icon-btn">…</button>
       <div class="validation-error">…</div>

   Behaviour:
     - Label is vertically centred inside the input when empty & unfocused
     - Label floats up to the top border (with white "cut-out" background)
       when the input is focused OR filled
     - Input content (typed text) sits BELOW the floated label position
     - Placeholder is always transparent — never visible
   ============================================================================ */
.form-floating-custom {
    position: relative;
    margin-bottom: 1.35rem;
}

    .form-floating-custom .form-control {
        /* CRITICAL: top padding must be big enough to clear the floated label */
        padding: 1.55rem 1.0rem 1.55rem 1.75rem;
        height: 40px;
        line-height: 1.0;
        font-size: 0.95rem;
        width: 100%;
        border: 2px solid var(--acc-border);
        border-radius: var(--acc-radius-sm);
        background: var(--acc-bg);
        color: var(--acc-text);
        transition: var(--acc-transition);
        /* Prevent the browser default floating-label overlap on autofill */
        -webkit-text-fill-color: var(--acc-text);
    }

        .form-floating-custom .form-control:focus {
            border-color: var(--acc-primary);
            box-shadow: 0 0 0 4px rgba(26, 122, 46, 0.12);
            background: #fff;
            outline: none;
        }

        .form-floating-custom .form-control.is-invalid {
            border-color: var(--acc-danger);
            box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
        }

            .form-floating-custom .form-control.is-invalid:focus {
                box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.2);
            }

        /* Placeholder is ALWAYS invisible — the label is the placeholder */
        .form-floating-custom .form-control::placeholder {
            color: transparent !important;
            opacity: 0;
        }

    /* Label — resting position (centred inside the input) */
    .form-floating-custom .form-label {
        position: absolute;
        top: 50%;
        left: 1rem;
        transform: translateY(-50%);
        color: var(--acc-muted);
        font-weight: 500;
        font-size: 0.9rem;
        padding: 0 0.35rem;
        margin: 0;
        background: transparent;
        display: flex;
        align-items: center;
        gap: 0.4rem;
        pointer-events: none;
        z-index: 2;
        transition: var(--acc-transition);
        /* No background until floated — so it visually sits inside the field */
        line-height: 1;
        white-space: nowrap;
    }

    /* Floated position (input focused OR has a value) */
    .form-floating-custom .form-control:focus ~ .form-label,
    .form-floating-custom .form-control:not(:placeholder-shown) ~ .form-label {
        top: 0;
        transform: translateY(-50%) scale(0.85);
        padding: 0 0.4rem;
        background: #fff; /* white cut-through effect */
        color: var(--acc-primary);
        font-weight: 600;
        /* Small negative margin pulls the label onto the border line */
        margin-left: -0.15rem;
    }

    .form-floating-custom .form-control.is-invalid ~ .form-label {
        color: var(--acc-danger);
    }

    /* Right-side icons */
    .form-floating-custom .field-icon {
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: #adb5bd;
        font-size: 1.05rem;
        pointer-events: none;
        z-index: 2;
        transition: var(--acc-transition);
    }

    .form-floating-custom .form-control:focus ~ .field-icon {
        color: var(--acc-primary);
    }

    .form-floating-custom .field-icon-btn {
        pointer-events: auto;
        background: transparent;
        border: none;
        padding: 0;
        cursor: pointer;
        width: 1.5rem;
        height: 1.5rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

        .form-floating-custom .field-icon-btn:hover {
            color: var(--acc-primary);
        }

    /* Per-field validation message */
    .form-floating-custom .validation-error {
        display: block;
        font-size: 0.78rem;
        color: var(--acc-danger);
        padding-left: 0.25rem;
        margin-top: 0.25rem;
    }

/* ============================================================================
   7. REMEMBER ME
   ============================================================================ */
.checkbox-custom {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 1rem 0 1.25rem;
}

    .checkbox-custom input[type="checkbox"] {
        width: 18px;
        height: 18px;
        border-radius: 4px;
        accent-color: var(--acc-primary);
        cursor: pointer;
        flex-shrink: 0;
        margin: 0;
    }

    .checkbox-custom label {
        margin: 0;
        color: var(--acc-text);
        font-size: 0.88rem;
        font-weight: 500;
        cursor: pointer;
        user-select: none;
    }

        .checkbox-custom label i {
            color: var(--acc-gold);
            margin-right: 0.25rem;
        }


/* ============================================================================
   8. PRIMARY BUTTON
   .btn-account is the markup class; .btn-login is kept as an alias for pages
   that still use the older class name.
   ============================================================================ */
.btn-account,
.btn-login {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: none;
    border-radius: var(--acc-radius-sm);
    background: linear-gradient(135deg, var(--acc-primary), var(--acc-primary-dark));
    color: #fff;
    box-shadow: 0 4px 20px rgba(26, 122, 46, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--acc-transition);
}

    .btn-account:hover:not(:disabled),
    .btn-login:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 8px 30px rgba(26, 122, 46, 0.4);
        background: linear-gradient(135deg, var(--acc-primary-dark), #0a4516);
        color: #fff;
    }

    .btn-account:active:not(:disabled),
    .btn-login:active:not(:disabled) {
        transform: translateY(0);
    }

    .btn-account:disabled,
    .btn-login:disabled {
        opacity: 0.7;
        cursor: not-allowed;
        transform: none;
    }


/* ============================================================================
   9. LINKS BLOCK
   ============================================================================ */
.account-links,
.login-links {
    margin-top: 1.5rem;
    text-align: center;
}

    .account-links .divider-line,
    .login-links .divider-line {
        border: 0;
        border-top: 1px solid rgba(0, 0, 0, 0.07);
        margin: 0.65rem auto;
        max-width: 60px;
    }

    .account-links .link-item,
    .login-links .link-item {
        display: block;
        padding: 0.35rem 0;
        color: var(--acc-muted);
        font-size: 0.85rem;
        text-decoration: none;
        transition: var(--acc-transition);
    }

        .account-links .link-item:hover,
        .login-links .link-item:hover {
            color: var(--acc-primary);
            transform: translateX(2px);
        }

        .account-links .link-item i,
        .login-links .link-item i {
            margin-right: 0.4rem;
            color: var(--acc-gold-dark);
            font-size: 0.85rem;
        }

    .account-links .support-link,
    .login-links .support-link {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        margin-top: 0.5rem;
        padding: 0.5rem 1rem;
        border-radius: 8px;
        background: rgba(26, 122, 46, 0.06);
        color: var(--acc-primary);
        font-size: 0.85rem;
        font-weight: 600;
        text-decoration: none;
        transition: var(--acc-transition);
    }

        .account-links .support-link:hover,
        .login-links .support-link:hover {
            background: rgba(26, 122, 46, 0.14);
            color: var(--acc-primary-dark);
            transform: translateX(3px);
        }

        .account-links .support-link i,
        .login-links .support-link i {
            color: var(--acc-gold-dark);
        }

    .login-links .login-footer-text,
    .account-links .login-footer-text {
        display: block;
        margin-top: 0.9rem;
        font-size: 0.7rem;
        letter-spacing: 0.02em;
        color: #adb5bd;
    }


/* ============================================================================
   10. VALIDATION SUMMARY
   .validation-summary-custom is the markup class; .validation-summary is kept
   as an alias for older pages.
   ============================================================================ */
.validation-summary-custom,
.validation-summary {
    background: rgba(220, 53, 69, 0.06);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    color: var(--acc-danger-dark);
    font-size: 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

    .validation-summary ul {
        margin: 0;
        padding-left: 1.1rem;
    }

        .validation-summary ul li {
            margin: 0.25rem 0;
        }


/* ============================================================================
   11. SUCCESS ICON  (used by confirmation pages)
   ============================================================================ */
.account-success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: rgba(26, 122, 46, 0.1);
    color: var(--acc-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}


/* ============================================================================
   12. SPINNER
   ============================================================================ */
.spinner-border-sm-custom {
    width: 1.15rem;
    height: 1.15rem;
    border-width: 2px;
}


/* ============================================================================
   13. ANIMATIONS
   ============================================================================ */
@keyframes accFadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes accFloatLogo {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}


/* ============================================================================
   14. RESPONSIVE
   ============================================================================ */
@media (max-width: 576px) {
    .account-card .card-header-custom {
        padding: 1.5rem 1.25rem 1rem;
    }

        .account-card .card-header-custom .logo-wrapper {
            width: 64px;
            height: 64px;
            font-size: 1.5rem;
        }

            .account-card .card-header-custom .logo-wrapper img {
                width: 48px;
                height: 48px;
            }

        .account-card .card-header-custom h2 {
            font-size: 1.35rem;
        }

    .account-card .card-body-custom {
        padding: 1.5rem 1.25rem;
    }

    .form-floating-custom .form-control {
        height: 50px;
        font-size: 0.9rem;
    }

    .form-floating-custom .form-label {
        font-size: 0.85rem;
    }

    .btn-account,
    .btn-login {
        font-size: 0.95rem;
        padding: 0.75rem;
    }

    .account-links .link-item,
    .login-links .link-item {
        font-size: 0.8rem;
    }

    .account-links .support-link,
    .login-links .support-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }
}

@media (max-width: 400px) {
    .account-card .card-header-custom h2 {
        font-size: 1.15rem;
    }

    .account-card .card-body-custom {
        padding: 1.25rem 1rem;
    }

    .checkbox-custom label {
        font-size: 0.82rem;
    }
}


/* ============================================================================
   15. UTILITIES
   ============================================================================ */
.text-gold {
    color: var(--acc-gold) !important;
}

.bg-gold {
    background-color: var(--acc-gold) !important;
}

.border-gold {
    border-color: var(--acc-gold) !important;
}
