/* eVolunteers Login Page Styles - improved, no overlap */

/* Design tokens */
:root {
    --bg: #f6f8fb;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --brand1: #1a365d;
    --brand2: #2c5282;
    --success1: #065f46;
    --success2: #059669;
    --shadow: 0 10px 30px rgba(0,0,0,.10);
    --shadow-soft: 0 6px 18px rgba(0,0,0,.08);
    --radius: 14px;
    --radius-sm: 10px;
    --focus: 0 0 0 4px rgba(44,82,130,.16);
}

/* Page safety */
html {
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    background: var(--bg);
    color: var(--text);
}

/* Shared container */
.login-container,
.welcome-container {
    max-width: 940px;
    width: 100%;
    margin: 0 auto;
    padding: 22px 16px;
}

/* Cards */
.login-card,
.welcome-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid rgba(17,24,39,.06);
}

/* Headers */
.login-header {
    background: linear-gradient(135deg, var(--brand1) 0%, var(--brand2) 100%);
    color: #fff;
    padding: 28px 28px;
    text-align: center;
}

    .login-header h1 {
        margin: 0 0 8px 0;
        font-size: clamp(1.6rem, 2.2vw, 2.05rem);
        font-weight: 700;
        letter-spacing: .2px;
        color: #fff;
        line-height: 1.2;
    }

    .login-header p {
        margin: 0;
        color: rgba(226,232,240,.95);
        font-size: 0.98rem;
    }

.welcome-header {
    background: linear-gradient(135deg, var(--success1) 0%, var(--success2) 100%);
    color: #fff;
    padding: 28px 28px;
    text-align: center;
}

    .welcome-header h2 {
        margin: 0;
        font-size: clamp(1.35rem, 2vw, 1.8rem);
        font-weight: 700;
        color: #fff;
        line-height: 1.25;
    }

/* Bodies */
.login-body,
.welcome-body {
    padding: 26px 30px 28px 30px;
}

.welcome-body {
    text-align: center;
}

    .welcome-body p {
        color: #374151;
        font-size: 1rem;
        margin: 0 0 1rem 0;
    }

/* Form */
.login-form {
    width: 100%;
}

    .login-form .form-group {
        margin-bottom: 1.1rem;
    }

    .login-form .form-label {
        font-weight: 600;
        color: #111827;
        margin-bottom: 0.45rem;
        display: block;
        line-height: 1.25;
    }

        .login-form .form-label small {
            color: var(--muted);
            font-weight: 500;
            margin-left: .35rem;
        }

        .login-form .form-label .required {
            color: #dc2626;
            margin-left: 2px;
        }

    /* Inputs */
    .login-form .form-control {
        width: 100%;
        border: 1px solid #d1d5db;
        border-radius: var(--radius-sm);
        padding: 12px 14px;
        font-size: 1rem;
        color: #111827;
        background-color: #ffffff;
        transition: border-color .18s ease, box-shadow .18s ease, transform .06s ease;
        outline: none;
        min-height: 44px; /* touch-friendly */
    }

        .login-form .form-control::placeholder {
            color: #9ca3af;
        }

        .login-form .form-control:focus {
            border-color: var(--brand2);
            box-shadow: var(--focus);
        }

        .login-form .form-control:disabled {
            background: #f9fafb;
            color: #9ca3af;
        }

/* Password toggle */
.password-wrapper {
    position: relative;
    width: 100%;
}

    .password-wrapper .form-control {
        padding-right: 48px;
    }

    /* Hide browser's default password reveal icon */
    .password-wrapper .form-control::-ms-reveal,
    .password-wrapper .form-control::-ms-clear {
        display: none;
    }

    .password-wrapper .form-control::-webkit-credentials-auto-fill-button,
    .password-wrapper .form-control::-webkit-textfield-decoration-container {
        display: none !important;
    }

    input[type="password"]::-ms-reveal,
    input[type="password"]::-ms-clear {
        display: none;
    }

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6b7280;
    font-size: 1.1rem;
    padding: 8px 10px;
    border-radius: 6px;
    line-height: 1;
    user-select: none;
    transition: color 0.15s ease, background-color 0.15s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .password-toggle:hover {
        color: #111827;
        background: rgba(17,24,39,.08);
    }

    .password-toggle:active {
        color: var(--brand2);
        background: rgba(17,24,39,.12);
    }

    .password-toggle i {
        pointer-events: none;
    }

/* Notices / alerts */
.registration-notice {
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius-sm);
    padding: 14px 14px;
    margin-bottom: 1.15rem;
}

    .registration-notice p {
        margin: 0;
        color: #0c4a6e;
        font-size: .95rem;
        line-height: 1.35;
    }

    .registration-notice i {
        color: #0369a1;
        margin-right: 6px;
    }

    .registration-notice a {
        color: #0369a1;
        font-weight: 700;
        text-decoration: none;
    }

        .registration-notice a:hover {
            text-decoration: underline;
        }

.alert-errors {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 14px 14px;
    margin-bottom: 1.15rem;
}

    .alert-errors ul {
        margin: 0;
        padding-left: 18px;
        color: #b91c1c;
    }

    .alert-errors li {
        margin: 0 0 6px 0;
    }

        .alert-errors li:last-child {
            margin-bottom: 0;
        }

/* reCAPTCHA - prevent overlap on small screens */
.recaptcha-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1.25rem 0 1rem 0;
    width: 100%;
    overflow: hidden; /* avoids spilling outside card */
}

    .recaptcha-wrapper .g-recaptcha {
        transform-origin: top center;
    }

/* Buttons */
.login-form .button-wrapper {
    text-align: center;
    margin-top: 1rem;
}

.btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 42px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: 0;
    background: linear-gradient(135deg, var(--brand1) 0%, var(--brand2) 100%);
    color: #ffffff;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
    min-height: 44px;
    text-decoration: none;
    box-shadow: var(--shadow-soft);
    white-space: nowrap;
    max-width: 100%;
}

    .btn-login:hover {
        transform: translateY(-1px);
        filter: brightness(1.02);
    }

    .btn-login:active {
        transform: translateY(0);
    }

    .btn-login:focus {
        outline: none;
        box-shadow: var(--shadow-soft), var(--focus);
    }

.btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 26px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background-color: #eef2f7;
    color: #111827;
    text-decoration: none;
    transition: background-color .18s ease, box-shadow .18s ease;
    border: 1px solid rgba(17,24,39,.08);
    min-height: 44px;
}

    .btn-logout:hover {
        background-color: #e5e7eb;
    }

/* Info + contact blocks */
.info-box {
    background: rgba(26,54,93,.08);
    border: 1px solid rgba(26,54,93,.12);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-top: 1.1rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

    .info-box i {
        color: var(--brand1);
        font-size: 1.15rem;
        margin-top: 2px;
    }

    .info-box span {
        color: #1f2937;
        font-size: .93rem;
        line-height: 1.35;
    }

/* Caps Lock Warning */
.capslock-warning {
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
    border: 1px solid #fda4af;
    border-left: 4px solid #e11d48;
    box-shadow: 0 8px 18px rgba(225,29,72,.12);
    align-items: center;
    gap: 12px;
    animation: capslock-slide-in .25s ease-out;
}

    .capslock-warning i {
        color: #be123c;
        font-size: 1rem;
        margin-top: 0;
    }

    .capslock-warning span {
        color: #881337;
        font-weight: 700;
        letter-spacing: .02em;
    }

@keyframes capslock-slide-in {
    0% {
        transform: translateY(-4px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.contact-section {
    background: linear-gradient(135deg, rgba(26,54,93,.96) 0%, rgba(44,82,130,.96) 100%);
    border-radius: var(--radius-sm);
    padding: 18px 18px;
    margin-top: 1.35rem;
}

    .contact-section h4 {
        color: #ffffff;
        margin: 0 0 8px 0;
        font-size: 1rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .contact-section p {
        margin: 0;
        color: rgba(226,232,240,.95);
        font-size: .95rem;
        line-height: 1.4;
    }

    .contact-section a {
        color: #bfdbfe;
        font-weight: 700;
        text-decoration: none;
    }

        .contact-section a:hover {
            color: #ffffff;
            text-decoration: underline;
        }

/* Footer links - never overlap */
.login-footer {
    text-align: center;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
    margin-top: 1.25rem;
}

.login-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 22px;
}

.login-footer a {
    color: var(--brand1);
    text-decoration: none;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(26,54,93,.06);
    transition: background-color .15s ease, color .15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

    .login-footer a:hover {
        color: var(--brand2);
        background: rgba(44,82,130,.10);
        text-decoration: none;
    }

/* Responsive */
@media (max-width: 950px) {
    .login-body,
    .welcome-body {
        padding: 22px 22px 24px 22px;
    }
}

@media (max-width: 600px) {
    .login-header,
    .welcome-header {
        padding: 20px 18px;
    }

    .login-body,
    .welcome-body {
        padding: 18px 16px 20px 16px;
    }

    .btn-login {
        width: 100%;
        padding: 12px 18px;
        white-space: normal; /* prevent text overflow */
    }

    /* Scale reCAPTCHA so it fits without overlap */
    .recaptcha-wrapper .g-recaptcha {
        transform: scale(.86);
    }
}

@media (max-width: 420px) {
    .recaptcha-wrapper .g-recaptcha {
        transform: scale(.78);
    }
}

.btn-login--compact {
    width: auto;
    padding: 12px 30px;
    display: inline-flex;
}
/* --- HARD OVERLAP FIX (place at end of login.css) --- */
.login-body,
.login-form,
.info-box,
.login-footer,
.contact-section {
    position: static !important;
    float: none !important;
    clear: both !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
}

/* Ensure stacking + spacing is predictable */
.login-body {
    display: block !important;
    padding-bottom: 28px; /* gives breathing room at bottom */
}

/* Keep these from collapsing into each other */
.info-box {
    margin-top: 16px !important;
}

.login-footer {
    margin-top: 18px !important;
}

.contact-section {
    margin-top: 18px !important;
}

/* If any parent container is doing weird stacking, isolate it */
.login-card {
    isolation: isolate;
}

/* Registration Styles */
.register-container {
    max-width: 700px;
}

.step-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
}

.step-dot.active {
    background: #fff;
}

.terms-text {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #374151;
    max-height: 200px;
    overflow-y: auto;
}

.radio-group {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin: 1rem 0;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    font-weight: 500;
}

.radio-group input[type="radio"] {
    width: 18px;
    height: 18px;
}

.info-box-light {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 1rem;
    text-align: center;
    color: #0c4a6e;
}

.info-box-light i {
    color: #0284c7;
    margin-right: 6px;
}

.info-box-light a {
    color: #0369a1;
    font-weight: 600;
}

.info-box-light ul {
    margin: 0;
    padding-left: 20px;
    color: #0c4a6e;
}

.info-box-light li {
    margin-bottom: 4px;
}

.readonly-field {
    background: #f3f4f6;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: #374151;
    font-weight: 500;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 1.5rem;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background-color: #e5e7eb;
    color: #374151;
    text-decoration: none;
    border: 1px solid #d1d5db;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #d1d5db;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--brand1) 0%, var(--brand2) 100%);
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

.success-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.success-header i {
    font-size: 2rem;
    color: var(--success2);
}

.success-header h3 {
    margin: 0;
    color: var(--success1);
    font-size: 1.5rem;
}

.success-icon {
    font-size: 2.5rem;
    color: var(--success2);
}

/* Password Strength Checker Styles */
.password-checker {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
    margin-bottom: 1rem;
}

.password-checker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.password-checker-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
}

.password-strength-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.strength-weak {
    background: #fee2e2;
    color: #dc2626;
}

.strength-fair {
    background: #fef3c7;
    color: #d97706;
}

.strength-good {
    background: #dbeafe;
    color: #2563eb;
}

.strength-strong {
    background: #dcfce7;
    color: #16a34a;
}

.strength-meter {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}

.strength-meter-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease, background-color 0.3s ease;
    width: 0%;
}

.meter-weak {
    background: linear-gradient(90deg, #ef4444, #f87171);
    width: 25%;
}

.meter-fair {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    width: 50%;
}

.meter-good {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    width: 75%;
}

.meter-strong {
    background: linear-gradient(90deg, #22c55e, #4ade80);
    width: 100%;
}

.password-requirements {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (max-width: 500px) {
    .password-requirements {
        grid-template-columns: 1fr;
    }
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #6b7280;
    transition: color 0.2s ease;
}

.requirement-item.met {
    color: #16a34a;
}

.requirement-item .req-icon {
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
    color: #d1d5db;
    font-weight: bold;
}

.requirement-item.met .req-icon {
    color: #16a34a;
}

/* Password Match Indicator */
.password-match {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.password-match.hidden {
    display: none;
}

.password-match.matching {
    background: #dcfce7;
    color: #16a34a;
}

.password-match.not-matching {
    background: #fee2e2;
    color: #dc2626;
}

.password-match .match-icon {
    font-weight: bold;
    font-size: 1rem;
}

.info-box-warning {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 1rem;
    text-align: center;
    color: #92400e;
}

.info-box-warning i {
    color: #d97706;
    margin-right: 6px;
}

.info-box-warning a {
    color: #b45309;
    font-weight: 600;
}

.help-content {
    padding: 0 0.5rem;
}

.help-content h4 {
    color: var(--brand1);
    margin: 1.5rem 0 0.75rem 0;
    text-align: center;
}

.help-content ol {
    padding-left: 1.5rem;
    margin: 0 0 1rem 0;
}

.help-content li {
    margin-bottom: 0.5rem;
    color: #374151;
    line-height: 1.5;
}

.help-content p {
    color: #374151;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.help-content a {
    color: var(--brand2);
    font-weight: 500;
}
