:root {
    --auth-primary: #6D1232;
    --auth-primary-dark: #4A0D24;
    --auth-primary-light: #8C1D45;
    --auth-gold: #D6A84F;
    --auth-gold-deep: #B88425;
    --auth-ivory: #FFFDF8;
    --auth-cream: #FBF7F0;
    --auth-ink: #1B1420;
    --auth-muted: #615665;
    --auth-line: rgba(109, 18, 50, 0.15);
    --auth-white: #FFFFFF;
    --auth-green: #12845B;
}

* {
    box-sizing: border-box;
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--auth-ink);
    background:
        linear-gradient(115deg, rgba(255, 253, 248, 0.96) 0%, rgba(251, 247, 240, 0.94) 46%, rgba(74, 13, 36, 0.86) 100%),
        url('../img/Religious-art-background.png') center/cover fixed;
}

body.auth-page a {
    color: var(--auth-primary);
}

.auth-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 253, 248, 0.92);
    border-bottom: 1px solid rgba(109, 18, 50, 0.12);
    backdrop-filter: blur(16px);
}

.auth-header-inner {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: var(--auth-ink);
}

.auth-brand img {
    width: auto;
    height: 50px;
    display: block;
}

.auth-brand-text {
    display: grid;
    gap: 0.05rem;
}

.auth-brand-text strong {
    font-family: 'Fraunces', serif;
    font-size: 1.15rem;
    line-height: 1;
}

.auth-brand-text span {
    color: var(--auth-muted);
    font-size: 0.82rem;
    line-height: 1.2;
}

.auth-nav {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.auth-nav a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.68rem 0.92rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 800;
    color: var(--auth-primary-dark);
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.auth-nav a:hover {
    background: rgba(109, 18, 50, 0.08);
    transform: translateY(-1px);
}

.auth-nav .auth-nav-primary {
    color: var(--auth-white);
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-light));
    box-shadow: 0 12px 28px rgba(109, 18, 50, 0.22);
}

.auth-main {
    position: relative;
    overflow: hidden;
}

.auth-main::after {
    content: '';
    position: absolute;
    inset: auto -12% -220px 48%;
    height: 440px;
    background: radial-gradient(circle, rgba(214, 168, 79, 0.28), transparent 62%);
    pointer-events: none;
}

.auth-section {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    min-height: calc(100vh - 82px);
    padding: 4.5rem 0 3rem;
    position: relative;
    z-index: 1;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(380px, 0.72fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
}

.signup-shell {
    grid-template-columns: minmax(360px, 0.82fr) minmax(0, 1fr);
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 34px;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(214, 168, 79, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--auth-primary-dark);
    font-size: 0.86rem;
    font-weight: 900;
    margin-bottom: 1.15rem;
}

.auth-kicker i {
    color: var(--auth-gold-deep);
}

.auth-copy h1 {
    margin: 0 0 1rem;
    font-family: 'Fraunces', serif;
    font-size: clamp(2.55rem, 5vw, 4.6rem);
    line-height: 1.02;
    letter-spacing: 0;
    color: var(--auth-ink);
}

.auth-copy h1 span {
    color: var(--auth-primary);
}

.auth-copy p {
    max-width: 660px;
    margin: 0 0 2rem;
    color: #4B5563;
    font-size: 1.14rem;
    line-height: 1.7;
}

.auth-proof-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin: 0 0 1.5rem;
}

.auth-proof {
    min-height: 120px;
    padding: 1rem;
    border: 1px solid rgba(109, 18, 50, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.68);
    box-shadow: 0 18px 42px rgba(74, 13, 36, 0.08);
}

.auth-proof i {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--auth-white);
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-light));
    margin-bottom: 0.7rem;
}

.auth-proof strong {
    display: block;
    color: var(--auth-ink);
    font-size: 0.98rem;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.auth-proof span {
    display: block;
    color: var(--auth-muted);
    font-size: 0.86rem;
    line-height: 1.35;
}

.auth-note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 600px;
    padding: 1rem 1.1rem;
    border-left: 4px solid var(--auth-gold);
    background: rgba(255, 255, 255, 0.7);
    color: var(--auth-muted);
    border-radius: 0 8px 8px 0;
}

.auth-note i {
    color: var(--auth-primary);
    margin-top: 0.25rem;
}

.auth-form,
.auth-card,
.homily-preview-container {
    border: 1px solid var(--auth-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 26px 70px rgba(74, 13, 36, 0.18);
}

.auth-form {
    padding: clamp(1.4rem, 3vw, 2.15rem);
}

.auth-form-header {
    margin-bottom: 1.4rem;
}

.auth-form h2 {
    margin: 0 0 0.45rem;
    font-family: 'Fraunces', serif;
    font-size: clamp(1.85rem, 3vw, 2.45rem);
    color: var(--auth-ink);
    line-height: 1.08;
    letter-spacing: 0;
}

.auth-form .subtitle,
.auth-form-header p {
    margin: 0;
    color: var(--auth-muted);
    line-height: 1.55;
}

.form-group {
    margin-bottom: 1rem;
}

.auth-form .form-group label {
    display: block;
    margin-bottom: 0.44rem;
    color: var(--auth-ink);
    font-weight: 900;
    font-size: 0.92rem;
}

.auth-form .form-group input {
    width: 100%;
    min-height: 52px;
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(109, 18, 50, 0.18);
    border-radius: 8px;
    background: var(--auth-ivory);
    color: var(--auth-ink);
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-form .form-group input:focus {
    border-color: var(--auth-primary);
    background: var(--auth-white);
    outline: none;
    box-shadow: 0 0 0 4px rgba(109, 18, 50, 0.12);
}

.auth-form small {
    display: block;
    margin-top: 0.42rem;
    color: var(--auth-muted);
    font-size: 0.82rem;
}

.forgot-password-link {
    text-align: right;
    margin-top: 0.55rem;
    font-size: 0.9rem;
}

.forgot-password-link a,
.auth-switch a,
.login-link a {
    font-weight: 900;
    text-decoration: none;
}

.forgot-password-link a:hover,
.auth-switch a:hover,
.login-link a:hover {
    text-decoration: underline;
}

.auth-submit,
.auth-form .btn-primary,
.auth-form .full-width {
    width: 100%;
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 0.35rem;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-light));
    color: var(--auth-white);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(109, 18, 50, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.auth-submit:hover,
.auth-form .btn-primary:hover,
.auth-form .full-width:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(109, 18, 50, 0.3);
}

.auth-submit:disabled,
.auth-form .btn-primary:disabled,
.auth-form .full-width:disabled {
    cursor: wait;
    opacity: 0.75;
    transform: none;
}

.auth-switch,
.login-link {
    margin: 1.35rem 0 0;
    text-align: center;
    color: var(--auth-muted);
}

.error-message,
.success-message,
.status-message {
    margin: 1rem 0 0;
    padding: 0.92rem 1rem;
    border-radius: 8px;
    font-weight: 800;
    line-height: 1.45;
}

.error-message,
.status-message.error,
#signupStatus {
    background: #FFF1F2;
    color: #A11933;
    border: 1px solid rgba(161, 25, 51, 0.25);
}

.success-message,
.status-message.success {
    background: #ECFDF5;
    color: var(--auth-green);
    border: 1px solid rgba(18, 132, 91, 0.24);
}

.hidden {
    display: none;
}

.signup-grid {
    display: grid;
    grid-template-columns: minmax(340px, 0.78fr) minmax(0, 1fr);
    gap: 1.2rem;
    align-items: stretch;
}

.homily-preview-container {
    padding: clamp(1.25rem, 2.5vw, 1.8rem);
    max-height: 760px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.homily-preview-container > h3 {
    margin: 0 0 1rem;
    font-family: 'Fraunces', serif;
    color: var(--auth-ink);
    font-size: 1.5rem;
}

#homily-preview {
    min-height: 240px;
    overflow: auto;
    padding-right: 0.35rem;
    color: var(--auth-muted);
    line-height: 1.65;
}

#homily-preview p {
    margin: 0 0 0.85rem;
}

.preview-header {
    margin-bottom: 1rem;
}

.preview-header h3 {
    margin: 0 0 0.25rem;
    color: var(--auth-primary-dark);
    font-size: 1.15rem;
}

.passage-ref {
    margin: 0;
    color: var(--auth-primary);
    font-weight: 900;
}

.preview-content {
    position: relative;
}

.preview-footer {
    margin-top: 1rem;
    padding: 0.95rem;
    border: 1px solid rgba(214, 168, 79, 0.28);
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.86);
    color: var(--auth-primary-dark);
    font-style: normal;
    font-weight: 800;
    text-align: left;
}

.sermon-section {
    padding: 0.95rem;
    border: 1px solid rgba(109, 18, 50, 0.1);
    border-radius: 8px;
    background: var(--auth-ivory);
    margin-bottom: 0.8rem;
}

.sermon-section h4 {
    margin: 0 0 0.35rem;
    color: var(--auth-primary-dark);
}

.auth-footer {
    position: relative;
    z-index: 1;
    background: var(--auth-ivory);
    border-top: 1px solid rgba(109, 18, 50, 0.12);
    padding: 1.2rem 0 2rem;
}

.auth-footer .container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    text-align: center;
    color: rgba(27, 20, 32, 0.78);
    font-size: 0.92rem;
}

.auth-footer p,
.auth-footer span {
    color: rgba(27, 20, 32, 0.78) !important;
}

.auth-footer a {
    color: var(--auth-primary) !important;
    font-weight: 900;
    text-decoration: none;
}

@media (max-width: 980px) {
    .auth-shell,
    .signup-shell,
    .signup-grid {
        grid-template-columns: 1fr;
    }

    .auth-copy {
        display: none;
    }

    .auth-section {
        min-height: auto;
        padding: 1.25rem 0 2rem;
    }

    .auth-proof-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .auth-header-inner,
    .auth-section,
    .auth-footer .container {
        width: min(100% - 28px, 1180px);
    }

    .auth-header-inner {
        min-height: auto;
        padding: 0.9rem 0;
        align-items: flex-start;
        flex-direction: column;
    }

    .auth-brand img {
        height: 44px;
    }

    .auth-brand-text span {
        display: none;
    }

    .auth-nav {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
    }

    .auth-nav a {
        min-height: 40px;
        padding: 0.55rem 0.45rem;
        font-size: 0.86rem;
    }

    .auth-section {
        min-height: auto;
        padding: 2.4rem 0 2rem;
    }

    .auth-copy h1 {
        font-size: 2.55rem;
    }

    .auth-proof-grid {
        grid-template-columns: 1fr;
    }

    .auth-proof {
        min-height: auto;
    }

    .auth-note {
        border-left-width: 3px;
    }
}
