/* Shared styles for login.php and register.php */
:root {
    --bg: #0d0d0d;
    --surface: #141414;
    --surface-raised: #1a1a1a;
    --surface-overlay: #1f1f1f;
    --line: #262626;
    --line-strong: #333333;
    --text: #f5f5f5;
    --text-secondary: #a3a3a3;
    --text-muted: #737373;
    --accent: #c8a45a;
    --accent-glow: rgba(200, 164, 90, 0.15);
    --accent-muted: #8b7355;
    --danger: #dc3545;
    --danger-bg: rgba(220, 53, 69, 0.1);
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --radius: 8px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── PAGE TRANSITIONS (cross-document View Transitions) ── */
@view-transition { navigation: auto; }

/* The whole logo (icon + text + Suite) is ONE shared element */
.brand-mark { view-transition-name: brand; }

/* Photo side stays put between login <-> register; only the form side fades */
.auth__visual { view-transition-name: auth-visual; }
.auth__panel  { view-transition-name: auth-panel; }

::view-transition-group(*) {
    animation-duration: 0.9s;
    animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
}
::view-transition-old(root) { animation: vt-out 0.4s ease-in both; }
::view-transition-new(root) { animation: vt-in 0.6s ease-out 0.25s both; }

/* Logo: show only the new snapshot so it can never blink, and keep it above the photo */
::view-transition-group(brand) { z-index: 10; }
::view-transition-old(brand)   { display: none; }
::view-transition-new(brand)   { animation: none; mix-blend-mode: normal; opacity: 1; }

@keyframes vt-out { to   { opacity: 0; } }
@keyframes vt-in  { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── SPLIT LAYOUT ── */
.auth {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
    min-height: 100vh;
}

.auth__visual {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 48px;
    background: var(--surface-raised) url('/backgrounds/background_8.jpg') center 20% / cover no-repeat;
}

.auth__visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(13, 13, 13, 0.55) 0%, rgba(13, 13, 13, 0) 30%, rgba(13, 13, 13, 0.85) 100%),
        linear-gradient(90deg, rgba(13, 13, 13, 0) 70%, rgba(13, 13, 13, 0.6) 100%);
}

.auth__visual > * { position: relative; z-index: 1; }

/* ── BRAND (must stay identical to .brand in index.css) ── */
.brand-mark {
    display: inline-flex;
    align-self: flex-start;   /* box fits its content instead of stretching full width */
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.brand-mark__icon {
    width: 42px;
    height: 42px;
    border: 1.5px solid var(--accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.3rem;
    color: var(--accent);
    background: rgba(13, 13, 13, 0.4);
}

.brand-mark__body { display: block; }

.brand-mark__text {
    display: block;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.4rem;
    font-weight: 500;
    line-height: 1.1;
    color: #fff;
}

.brand-mark__sub { display: block; font-size: 0.78rem; color: var(--accent); }

.auth__tagline {
    max-width: 13em;
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 4vw, 3.6rem);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -0.02em;
    color: #fff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.auth__tagline-sub {
    margin-top: 14px;
    max-width: 30em;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.78);
}

/* ── FORM PANEL ── */
.auth__panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(200, 164, 90, 0.06) 0%, transparent 60%),
        var(--bg);
}

.auth__box {
    width: 100%;
    max-width: 400px;
    animation: boxIn 0.8s 0.4s ease-out both;
}

@keyframes boxIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth__title {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}

.auth__sub {
    margin-bottom: 30px;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

/* ── FLASH ── */
.flash-message {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 22px;
    font-size: 0.875rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.flash-message--success { background: rgba(74, 222, 128, 0.08); border: 1px solid rgba(74, 222, 128, 0.22); color: #4ade80; }
.flash-message--error   { background: var(--danger-bg); border: 1px solid rgba(220, 53, 69, 0.25); color: #f87171; }
.flash-message--info    { background: rgba(200, 164, 90, 0.08); border: 1px solid rgba(200, 164, 90, 0.22); color: var(--accent); }

/* ── FORM ── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 13px 15px;
    background: var(--surface-raised);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:focus {
    border-color: var(--accent);
    background: var(--surface-overlay);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input--error { border-color: rgba(220, 53, 69, 0.6); }

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 24px;
}

.remember-me {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: var(--surface-raised);
    flex-shrink: 0;
    transition: all var(--transition);
}

.checkbox-custom::after {
    content: '✓';
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--accent);
    opacity: 0;
    transition: opacity var(--transition);
}

input[type="checkbox"]:checked + .checkbox-custom { border-color: var(--accent); background: var(--accent-glow); }
input[type="checkbox"]:checked + .checkbox-custom::after { opacity: 1; }
input[type="checkbox"]:focus-visible + .checkbox-custom { box-shadow: 0 0 0 3px var(--accent-glow); }

.remember-me__text { font-size: 0.85rem; color: var(--text-secondary); }

.forgot-link {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}
.forgot-link:hover { color: var(--accent); }

.btn-submit {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius);
    background: var(--accent);
    color: #1a1407;
    font-family: var(--font-body);
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}
.btn-submit:hover { background: #d9b76d; box-shadow: 0 6px 18px rgba(200, 164, 90, 0.28); transform: translateY(-1px); }
.btn-submit:active { transform: translateY(0); }
.btn-submit:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.switch-link {
    margin-top: 26px;
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-secondary);
}
.switch-link a { color: var(--accent); text-decoration: none; font-weight: 500; }
.switch-link a:hover { text-decoration: underline; }

/* Button that looks like a .switch-link link (e.g. "send a new code") */
.link-button {
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--accent);
    font-weight: 500;
    cursor: pointer;
}
.link-button:hover { text-decoration: underline; }
.link-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.back-link {
    display: block;
    margin-top: 14px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}
.back-link:hover { color: var(--accent); }

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
    .auth { grid-template-columns: 1fr; }
    .auth__visual { min-height: 170px; padding: 24px; }
    .auth__tagline, .auth__tagline-sub { display: none; }
    .auth__panel { align-items: flex-start; padding: 32px 22px 48px; }
    .auth__title { font-size: 2.1rem; }
}

@media (max-width: 480px) {
    .form-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .flash-message, .auth__box { animation: none; }
    .btn-submit, .form-input { transition: none; }
}