/* ══════════════════════════════════════════════
   ALTAR SUITE GH — LOGIN PAGE  (black & cream)
   ══════════════════════════════════════════════ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── DESIGN TOKENS ── */
:root {
    /* blacks */
    --bg:           #080808;
    --surface:      #101010;
    --surface-2:    #181818;
    --surface-3:    #202020;

    /* borders */
    --border:       #2A2A2A;
    --border-2:     #383838;

    /* cream / parchment */
    --cream:         #F5EFE0;
    --cream-light:   #FAF6ED;
    --cream-bright:  #FDFAF4;
    --cream-dim:     rgba(245, 239, 224, 0.08);
    --cream-border:  rgba(245, 239, 224, 0.18);

    /* wine / champagne (button + accents) */
    --wine:          #7B2D3E;
    --champ:         #C9955A;
    --champ-light:   #DEBB8A;
    --champ-bright:  #EDD9B0;
    --champ-dim:     rgba(201, 149, 90, 0.09);
    --champ-border:  rgba(201, 149, 90, 0.25);

    /* text */
    --text-1:        #F5EFE0;
    --text-2:        #B0A898;
    --text-3:        #6A6258;

    /* status */
    --error:         #C0392B;
}

/* ── BASE ── */
html,
body {
    height: 100%;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── LAYOUT ── */
.container {
    display: flex;
    height: 100vh;
    height: 100dvh;
    height: 100svh;
    width: 100vw;
}

/* ══════════════════════════════════════
   LEFT PANEL
   ══════════════════════════════════════ */
.left {
    flex: 1 1 50%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 56px 60px;
}

.left-bg {
    position: absolute;
    inset: 0;
    background-image: url('../assets/bg_cathedral.png');
    background-size: cover;
    background-position: center top;
    z-index: 0;
}

/* dark overlay so text stays readable over the photo */
.left::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg,
            rgba(8, 8, 8, 0.30)  0%,
            rgba(8, 8, 8, 0.15) 30%,
            rgba(8, 8, 8, 0.72) 68%,
            rgba(8, 8, 8, 0.96) 100%),
        linear-gradient(90deg,
            rgba(8, 8, 8, 0.55) 0%,
            transparent 100%);
    z-index: 2;
    pointer-events: none;
}

/* decorative lines */
.deco-lines {
    position: absolute;
    top: 0;
    right: 0;
    width: 180px;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.deco-lines span {
    position: absolute;
    right: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent 0%, var(--cream) 30%, transparent 100%);
    opacity: 0.10;
    animation: linePulse 4s ease-in-out infinite;
}

.deco-lines span:nth-child(1) {
    height: 70%;
    top: 15%;
    right: 0;
    animation-delay: 0s;
}

.deco-lines span:nth-child(2) {
    height: 50%;
    top: 25%;
    right: 24px;
    animation-delay: 0.8s;
    opacity: 0.06;
}

.deco-lines span:nth-child(3) {
    height: 35%;
    top: 32%;
    right: 48px;
    animation-delay: 1.6s;
    opacity: 0.04;
}

@keyframes linePulse {
    0%, 100% { opacity: 0.10; }
    50%       { opacity: 0.22; }
}

/* arch ornament */
.arch {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    height: 220px;
    border: 1px solid rgba(245, 239, 224, 0.10);
    border-radius: 130px 130px 0 0;
    z-index: 3;
}

.arch::after {
    content: '';
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(245, 239, 224, 0.05);
    border-radius: 110px 110px 0 0;
}

.left-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;   /* horizontal centering */
    text-align: center;
}

.portal-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--champ);
    margin-bottom: 28px;
}

.left-headline {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(42px, 5vw, 72px);
    font-weight: 300;
    line-height: 1.15;
    color: var(--text-1);
    margin-bottom: 24px;
}

.left-headline em {
    font-style: italic;
    background: linear-gradient(135deg, var(--champ) 0%, var(--champ-bright) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.left-desc {
    font-size: clamp(12.5px, 1.1vw, 14px);
    font-weight: 300;
    line-height: 1.78;
    color: var(--text-2);
    max-width: 380px;
    margin-bottom: 40px;
    text-align: center;
}

.left-footer {
    font-size: 12px;
    color: var(--text-3);
    letter-spacing: 0.05em;
    /* footer stays as its own line, not centered with the rest */
    align-self: center;
    text-align: center;
    margin-top: auto;   /* pushes it toward the bottom when space allows */
}

/* ══════════════════════════════════════
   RIGHT PANEL
   ══════════════════════════════════════ */
.right {
    flex: 1 1 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.right-bg-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(245, 239, 224, 0.03) 1px, transparent 1px);
    background-size: 28px 28px;
    z-index: 0;
    pointer-events: none;
}

.right-bg-glow {
    position: absolute;
    top: -80px;
    right: -80px;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 149, 90, 0.06) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
    filter: blur(20px);
}

/* ── LOGIN CARD ── */
.login-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 400px;
}

.login-header {
    margin-bottom: 32px;
}

.login-header h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 500;
    color: var(--text-1);
    line-height: 1.15;
    margin-bottom: 8px;
}

.login-header p {
    font-size: 13.5px;
    color: var(--text-2);
    font-weight: 400;
}

/* divider */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.divider span {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(245, 239, 224, 0.12) 50%, transparent);
}

.divider i {
    font-size: 10px;
    color: var(--champ);
    letter-spacing: 0.25em;
    font-style: normal;
    text-transform: uppercase;
    font-weight: 500;
    opacity: 0.7;
}

/* error */
.error-msg {
    display: none;
    background: rgba(192, 57, 43, 0.07);
    border: 1px solid rgba(192, 57, 43, 0.20);
    border-radius: 5px;
    padding: 11px 15px;
    font-size: 13px;
    color: var(--error);
    margin-bottom: 22px;
    line-height: 1.5;
}

.error-msg.show { display: block; }

/* form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 7px;
    transition: color 0.2s;
}

.form-group:focus-within label {
    color: var(--champ);
}

.input-wrap {
    position: relative;
}

.input-wrap svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    stroke: var(--text-3);
    fill: none;
    stroke-width: 1.6;
    pointer-events: none;
    transition: stroke 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--text-3);
}

.input-wrap input {
    width: 100%;
    padding: 13px 16px 13px 42px;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-1);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    outline: none;
    transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
}

.input-wrap input::placeholder {
    color: var(--text-3);
}

.input-wrap input:focus {
    border-color: var(--border-accent);
    box-shadow: 0 0 0 4px rgba(201, 149, 90, 0.08);
    background: var(--surface-2);
}

.input-wrap input:focus + svg,
.input-wrap input:focus ~ svg {
    stroke: var(--champ-light);
    transform: translateY(-50%) scale(1.05);
    color: var(--champ-light);
}

.input-wrap .eye-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    z-index: 2;
}

.input-wrap .eye-btn:hover {
    color: var(--champ);
}

.input-wrap .eye-btn svg {
    position: static;
    transform: none;
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.input-wrap.has-eye input {
    padding-right: 42px;
}

.row-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-2);
    font-weight: 400;
    user-select: none;
    transition: color 0.2s;
}

.remember:hover {
    color: var(--text-1);
}

.remember input[type="checkbox"] {
    display: none;
}

.remember .check-box {
    width: 17px;
    height: 17px;
    border: 1px solid var(--border-2);
    border-radius: 3px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.remember:hover .check-box {
    border-color: var(--champ-border);
}

.remember input:checked ~ .check-box {
    background: var(--champ);
    border-color: var(--border-accent);
}

.remember .check-box::after {
    content: '';
    display: none;
    width: 5px;
    height: 9px;
    border: 1.5px solid #080808;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

.remember input:checked ~ .check-box::after {
    display: block;
}

.forgot {
    font-size: 13px;
    color: var(--champ);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.2s;
}

.forgot:hover {
    color: var(--champ-light);
    text-decoration: underline;
}

/* ── CTA BUTTON — wine → champagne, no glow ── */
.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(130deg,
        var(--wine)        0%,
        #A0433A           28%,
        var(--champ)       65%,
        var(--champ-light) 100%);
    color: var(--cream-bright);
    border: none;
    border-radius: 5px;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: filter 0.25s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.btn-login:hover {
    filter: brightness(1.10);
    transform: translateY(-2px);
    box-shadow: none;
}

.btn-login:hover::before {
    transform: translateX(100%);
}

.btn-login:active {
    filter: brightness(0.96);
    transform: translateY(0);
    box-shadow: none;
}

.login-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 13px;
    color: var(--text-3);
}

.login-footer a {
    color: var(--champ);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.login-footer a:hover {
    color: var(--champ-light);
    text-decoration: underline;
}



/* error state */
.error-msg {
    display: none;
    background: rgba(192, 57, 43, 0.07);
    border: 1px solid rgba(192, 57, 43, 0.20);
    border-radius: 5px;
    padding: 11px 15px;
    font-size: 13px;
    color: var(--error);
    margin-bottom: 22px;
    line-height: 1.5;
}

.error-msg.show {
    display: block;
}

/* loading spinner */
.btn-login .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(245, 239, 224, 0.25);
    border-top-color: var(--cream-bright);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-login.loading .label {
    display: none;
}

.btn-login.loading .spinner {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.left-content > * {
    opacity: 0;
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.portal-name {
    animation-delay: 0.1s;
}

.left-headline {
    animation-delay: 0.2s;
}

.left-desc {
    animation-delay: 0.32s;
}

.left-footer {
    animation-delay: 0.44s;
}

.login-card {
    opacity: 0;
    transform: translateY(14px);
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

.error-msg {
    animation: none;
    opacity: 1;
    transform: none;
}

/* ── RESPONSIVE: TABLET ── */
@media (max-width: 960px) {
    .left {
        padding: 48px 40px;
        flex: 1;
    }

    .right {
        padding: 32px;
        flex: 1;
    }
}

/* ── RESPONSIVE: MOBILE ── */
@media (max-width: 768px) {

    html,
    body {
        overflow-y: auto;
        overflow-x: hidden;
        height: auto;
    }

    .container {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        min-height: 100svh;
    }

    .left {
        display: none;
    }

    .right {
        flex: 1;
        width: 100%;
        padding: 64px 24px;
        min-height: 100vh;
        min-height: 100dvh;
        min-height: 100svh;
        align-items: center;
        overflow: visible;
    }

    .login-card {
        max-width: 400px;
        width: 100%;
        background: transparent;
        border: none;
        backdrop-filter: none;
        box-shadow: none;
        padding: 0;
    }
}

/* ── RESPONSIVE: SMALL MOBILE ── */
@media (max-width: 480px) {
    .right {
        padding: 48px 16px;
    }

    .login-header h2 {
        font-size: 28px;
    }
}

/* ═══════════════════════════════════════════════════
   SOFT UI THEME — matches the portal (dark)
   Near-black surfaces, neutral greys, sage accent,
   pill inputs and a solid light pill CTA.
═══════════════════════════════════════════════════ */
:root {
    --bg:           #080707;
    --surface:      #121111;
    --surface-2:    #1b1a1a;
    --surface-3:    #232222;
    --border:       #201f1f;
    --border-2:     #2e2d2d;

    --text-1:       #f5f5f5;
    --text-2:       #a3a3a3;
    --text-3:       #727272;

    --champ:        #e8e8e8;
    --champ-light:  #f2f2f2;
    --champ-bright: #fafafa;
    --champ-dim:    rgba(255, 255, 255, 0.084);
    --champ-border: rgba(255, 255, 255, 0.30);

    --btn-solid-bg: #f5f5f5;
    --btn-solid-fg: #080707;
}

.right-bg-pattern {
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
}

.right-bg-glow {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.042) 0%, transparent 70%);
}

.left::before {
    background:
        linear-gradient(180deg,
            rgba(8, 7, 7, 0.30) 0%,
            rgba(8, 7, 7, 0.15) 30%,
            rgba(8, 7, 7, 0.75) 68%,
            rgba(8, 7, 7, 0.97) 100%),
        linear-gradient(90deg, rgba(8, 7, 7, 0.55) 0%, transparent 100%);
}

/* header */
.login-header h2 {
    font-weight: 500;
    letter-spacing: -0.01em;
}

.divider span {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.10) 50%, transparent);
}

/* labels: quiet sentence case */
.form-group label {
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-2);
    margin-bottom: 8px;
    padding-left: 4px;
}

/* pill inputs */
.input-wrap input {
    border-radius: 999px;
    background: var(--surface-2);
    border-color: var(--border-2);
    padding: 14px 18px 14px 46px;
}

.input-wrap svg {
    left: 18px;
}

.input-wrap.has-eye input {
    padding-right: 48px;
}

.input-wrap .eye-btn {
    right: 14px;
    border-radius: 50%;
}

.input-wrap input:focus {
    border-color: var(--border-accent);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.10);
    background: var(--surface-3);
}

/* checkbox */
.remember .check-box {
    border-radius: 6px;
    background: var(--surface-2);
}

.remember .check-box::after {
    border-color: #080707;
}

/* primary CTA: solid light pill */
.btn-login {
    background: var(--btn-solid-bg);
    color: var(--btn-solid-fg);
    border: 1px solid var(--btn-solid-bg);
    border-radius: 999px;
    letter-spacing: 0.01em;
    padding: 14px 20px;
}

.btn-login::before {
    display: none;
}

.btn-login:hover {
    filter: none;
    background: color-mix(in srgb, var(--btn-solid-bg) 86%, var(--champ));
    border-color: color-mix(in srgb, var(--btn-solid-bg) 86%, var(--border-accent));
    transform: translateY(-1px);
}

.btn-login:active {
    filter: none;
    transform: translateY(0);
}

.btn-login .spinner {
    border-color: rgba(8, 7, 7, 0.2);
    border-top-color: #080707;
}

/* two-factor step: outlined pill cancel and pill code field */
#totpCancelBtn {
    background: transparent !important;
    color: var(--text-1) !important;
    border: 1px solid rgba(245, 245, 245, 0.3) !important;
}

#totpCancelBtn:hover {
    background: rgba(255, 255, 255, 0.06) !important;
}

#totpLoginCode {
    border-radius: 999px !important;
    background: var(--surface-2) !important;
    border: 1px solid var(--border-2) !important;
    color: var(--text-1) !important;
    outline: none;
}

#totpLoginCode:focus {
    border-color: var(--border-accent) !important;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.10);
}

.error-msg {
    border-radius: 16px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--champ-light);
    outline-offset: 3px;
}

/* Borders use a neutral light grey, not the accent colour */
:root,
html[data-theme="dark"] {
    --border-accent: #8a8a8a;
    --champ-border: rgba(255, 255, 255, 0.16);
    --gold-border: rgba(255, 255, 255, 0.16);
    --focus-ring: 0 0 0 2px rgba(255, 255, 255, 0.22);
}

html[data-theme="light"] {
    --border-accent: #5c5c5c;
    --champ-border: rgba(0, 0, 0, 0.18);
    --gold-border: rgba(0, 0, 0, 0.18);
    --focus-ring: 0 0 0 2px rgba(0, 0, 0, 0.18);
}

/* No outline or glow ring on focused inputs */
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}