/* ============================================
   SPAP USER LOGIN — Glass + Minimal UI
   Aligned with landing page
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   BACKGROUND — image + gradient + pattern
   ============================================ */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    position: relative;
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('../images/bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(92, 21, 21, 0.9) 0%,
                                rgba(44, 36, 32, 0.55) 55%,
                                rgba(44, 36, 32, 0.75) 100%);
    z-index: -1;
}

/* ============================================
   TOKENS
   ============================================ */

:root {
    --primary-maroon: #7F2020;
    --primary-dark:   #5C1515;
    --primary-light:  #9B2E2E;
    --sage-green:     #869B7E;
    --sage-dark:      #6B7D64;
    --soft-olive:     #C9CAAC;
    --warm-cream:     #F6F3EB;
    --text-dark:      #2C2420;
    --text-soft:      #5A4E45;
    --text-muted:     #8A7C70;
    --gold-accent:    #C9A84C;

    --success: #10B981;
    --warning: #F59E0B;
    --danger:  #EF4444;

    --glass-bg:        rgba(255, 255, 255, 0.72);
    --glass-bg-strong: rgba(255, 255, 255, 0.92);
    --glass-border:    rgba(255, 255, 255, 0.55);
    --glass-blur:      blur(20px) saturate(160%);

    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 32px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.18);
    --shadow-glow-maroon: 0 12px 32px rgba(127, 32, 32, 0.28);

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-fast: 150ms;
    --dur-base: 220ms;
    --dur-slow: 320ms;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Accessibility focus ring */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary-maroon);
    outline-offset: 3px;
}

/* Reusable glass surface */
.glass {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
}

/* ============================================
   CONTAINER
   ============================================ */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px;
    position: relative;
}

/* ============================================
   BACK TO HOME (floating)
   ============================================ */

.back-home {
    position: fixed;
    top: 24px;
    left: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: white;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--dur-base) var(--ease);
    z-index: 10;
}

.back-home:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(-3px);
}

.back-home i { font-size: 12px; }

/* ============================================
   LOGIN CARD
   ============================================ */

.login-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 460px;
    padding: 44px 40px 36px;
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    animation: cardIn 0.5s var(--ease-out);
    background: var(--glass-bg-strong) !important;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================
   HEADER
   ============================================ */

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-wrapper {
    position: relative;
    width: 92px;
    height: 92px;
    margin: 0 auto 18px;
    background: white;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    box-shadow:
        0 12px 32px rgba(127, 32, 32, 0.18),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    overflow: hidden;
}

.logo-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.14), transparent 60%);
    pointer-events: none;
}

.church-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
}

.login-header h2 {
    color: var(--text-dark);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
    line-height: 1.25;
}

.parish-location {
    color: var(--text-soft);
    font-size: 13px;
    letter-spacing: 0.3px;
    margin-bottom: 16px;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 100px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary-maroon);
    background: rgba(127, 32, 32, 0.08) !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: 1px solid rgba(127, 32, 32, 0.14);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.user-badge i { font-size: 12px; }

/* ============================================
   ALERTS
   ============================================ */

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 16px;
    animation: alertIn 0.3s var(--ease-out);
}

@keyframes alertIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert i { font-size: 16px; flex-shrink: 0; }

.alert-error {
    background: rgba(239, 68, 68, 0.10);
    color: #B03030;
    border: 1px solid rgba(239, 68, 68, 0.20);
}

.alert-success {
    background: rgba(16, 185, 129, 0.10);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.22);
}

/* ============================================
   SERVICE HINT (deep-link)
   ============================================ */

.service-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 13px;
    background: rgba(201, 168, 76, 0.10);
    color: #6b5600;
    border: 1px solid rgba(201, 168, 76, 0.28);
    margin-bottom: 16px;
}

.service-hint i {
    font-size: 15px;
    color: var(--gold-accent);
    flex-shrink: 0;
}

.service-hint strong {
    font-weight: 700;
    color: var(--text-dark);
}

/* ============================================
   FORM
   ============================================ */

.login-form {
    margin-top: 4px;
}

.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 7px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 13px;
    letter-spacing: 0.1px;
}

.input-group label i {
    font-size: 12px;
    color: var(--primary-maroon);
}

.input-wrapper {
    position: relative;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
    transition: color var(--dur-base) var(--ease);
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 1.5px solid rgba(201, 202, 172, 0.7);
    border-radius: 14px;
    font-size: 14.5px;
    font-family: inherit;
    color: var(--text-dark);
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: all var(--dur-base) var(--ease);
    min-height: 50px;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-maroon);
    background: white;
    box-shadow: 0 0 0 4px rgba(127, 32, 32, 0.10);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary-maroon);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* Password */
.password-wrapper input {
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--dur-base) var(--ease);
    font-family: inherit;
}

.toggle-password:hover {
    color: var(--primary-maroon);
    background: rgba(127, 32, 32, 0.06);
}

/* Form options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    gap: 12px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text-soft);
    user-select: none;
    position: relative;
    padding-left: 26px;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid rgba(201, 202, 172, 0.9);
    background: white;
    transition: all var(--dur-base) var(--ease);
}

.checkbox-label input:checked ~ .checkmark {
    background: linear-gradient(135deg, var(--primary-maroon), var(--primary-light));
    border-color: var(--primary-maroon);
}

.checkbox-label input:checked ~ .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input:focus-visible ~ .checkmark {
    outline: 2px solid var(--primary-maroon);
    outline-offset: 2px;
}

.checkbox-label:hover .checkmark {
    border-color: var(--primary-maroon);
}

.forgot-link {
    color: var(--primary-maroon);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: color var(--dur-base) var(--ease);
}

.forgot-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ============================================
   LOGIN BUTTON
   ============================================ */

.login-btn {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary-maroon) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--dur-base) var(--ease);
    box-shadow: 0 8px 22px rgba(127, 32, 32, 0.28);
    min-height: 52px;
    position: relative;
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 50%);
    opacity: 0;
    transition: opacity var(--dur-base) var(--ease);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-maroon);
}

.login-btn:hover::before { opacity: 1; }

.login-btn:active {
    transform: translateY(0);
}

.login-btn i { font-size: 16px; }

/* ============================================
   SIGNUP LINK
   ============================================ */

.signup-link {
    text-align: center;
    margin-top: 22px;
    margin-bottom: 4px;
}

.signup-link p {
    color: var(--text-soft);
    font-size: 13.5px;
}

.signup-link a {
    color: var(--primary-maroon);
    text-decoration: none;
    font-weight: 700;
    transition: color var(--dur-base) var(--ease);
}

.signup-link a:hover {
    color: var(--primary-light);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ============================================
   FOOTER
   ============================================ */

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(201, 202, 172, 0.5);
}

.login-footer p {
    color: var(--text-muted);
    font-size: 11.5px;
    margin-bottom: 12px;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.login-footer p i {
    color: var(--sage-green);
    font-size: 11px;
}

.security-badges {
    display: flex;
    justify-content: center;
    gap: 14px;
}

.security-badges span {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(134, 155, 126, 0.10);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sage-dark);
    font-size: 13px;
    transition: all var(--dur-base) var(--ease);
}

.security-badges span:hover {
    background: rgba(127, 32, 32, 0.10);
    color: var(--primary-maroon);
    transform: translateY(-2px);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
    .login-container {
        padding: 24px 16px;
    }

    .login-card {
        padding: 32px 22px 26px;
        border-radius: 22px;
        max-width: 100%;
    }

    .logo-wrapper {
        width: 78px;
        height: 78px;
        border-radius: 20px;
    }

    .login-header h2 { font-size: 19px; }
    .parish-location { font-size: 12px; }

    .form-options {
        flex-direction: row;
        align-items: center;
    }

    .back-home {
        top: 16px;
        left: 16px;
        padding: 9px 14px;
        font-size: 12.5px;
    }

    .back-home span { display: none; }
    .back-home { padding: 10px; border-radius: 10px; }

    .input-wrapper input {
        padding: 13px 14px 13px 40px;
        font-size: 14px;
        min-height: 48px;
    }

    .input-wrapper .input-icon {
        left: 14px;
        font-size: 13px;
    }
}

@media (max-width: 380px) {
    .login-card { padding: 26px 18px 22px; }
    .login-header h2 { font-size: 17px; }
    .login-btn { font-size: 14px; }
}