/* ==========================================================================
   The split-screen auth pages: sign in, sign up, and a team invitation.
   ==========================================================================
   Lifted out of login.html's inline <style> when the invitation page needed
   the same card, field and button vocabulary. Two copies would have drifted
   the first time either page was touched, and an invitation that does not
   look like the sign-in page reads as a phishing attempt -- which is the one
   impression it must never give.

   Anything below the INVITATION heading is new; everything above it is the
   login page's own CSS, moved verbatim.
   ========================================================================== */

/* ========== SHELL: split screen ========== */
.auth-shell {
    position: fixed; inset: 0; display: grid; grid-template-columns: 1.35fr 1fr;
    background: var(--bg-main); overflow: hidden;
}

/* ========== LEFT VISUAL PANEL ========== */
.auth-visual {
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(circle at 22% 18%, rgba(0,212,255,0.22), transparent 46%),
        linear-gradient(145deg, #071022 0%, #0a1a2f 60%, #060b15 100%);
}
[data-theme="light"] .auth-visual, body.light-theme .auth-visual {
    background:
        radial-gradient(circle at 22% 18%, rgba(255,255,255,0.28), transparent 46%),
        linear-gradient(145deg, #0369a1 0%, #0284c7 60%, #026aa1 100%);
}

/* Grid: strong at top-left, fading toward bottom-right (diagonal mask) */
.auth-visual-grid {
    position: absolute; inset: 0; z-index: 0;
    background-image: linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.07) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: linear-gradient(135deg, #000 0%, rgba(0,0,0,0.55) 45%, transparent 88%);
            mask-image: linear-gradient(135deg, #000 0%, rgba(0,0,0,0.55) 45%, transparent 88%);
}

/* Glow cells: sit exactly on grid squares */
.auth-glow-cells { position: absolute; inset: 0; z-index: 1; pointer-events: none;
    -webkit-mask-image: linear-gradient(135deg, #000 0%, rgba(0,0,0,0.5) 45%, transparent 85%);
            mask-image: linear-gradient(135deg, #000 0%, rgba(0,0,0,0.5) 45%, transparent 85%);
}
.glow-cell {
    position: absolute; width: 46px; height: 46px; border-radius: 5px;
    background: rgba(0,212,255,0.30); opacity: 0;
    animation: cellGlow var(--dur, 7s) ease-in-out infinite var(--delay, 0s);
    will-change: opacity;
}
[data-theme="light"] .glow-cell, body.light-theme .glow-cell { background: rgba(255,255,255,0.40); }
@keyframes cellGlow {
    0%       { opacity: 0; }
    50%      { opacity: 0.55; }
    100%     { opacity: 0; }
}

/* Blend the left panel into the page — diagonal fade matching the grid (TL solid, BR gone) */
.auth-visual-fade {
    position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: linear-gradient(135deg, transparent 35%, var(--bg-main) 92%);
}

.auth-orb { position: absolute; border-radius: 50%; filter: blur(46px); opacity: 0.5; z-index: 1; }
.auth-orb-1 { width: 300px; height: 300px; background: #00d4ff; top: -50px; left: -40px; animation: float1 26s ease-in-out infinite; }
.auth-orb-2 { width: 240px; height: 240px; background: #0096c7; top: 40%; left: 30%; animation: float2 30s ease-in-out infinite; }
@keyframes float1 { 0%,100%{ transform: translate(0,0) scale(1);} 50%{ transform: translate(26px,34px) scale(1.1);} }
@keyframes float2 { 0%,100%{ transform: translate(0,0) scale(1);} 50%{ transform: translate(-30px,-24px) scale(1.06);} }

.auth-visual-inner { position: relative; z-index: 3; max-width: 480px; padding: 3.5rem; color: #fff; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 2.5rem; }
/* The logo replaces the frosted-glass tile that held the old bolt icon: it has
   its own silhouette, so the glow is a drop-shadow on the alpha rather than a
   box-shadow around a square. */
.auth-brand-mark {
    width: 52px; height: 52px; flex: none; object-fit: contain;
    animation: iconIn 0.5s cubic-bezier(0.16,1,0.3,1),
               pulseMark 5s ease-in-out infinite;
}
@keyframes pulseMark {
    0%,100% { filter: drop-shadow(0 6px 16px rgba(0,212,255,0.35)); }
    50%     { filter: drop-shadow(0 6px 26px rgba(0,212,255,0.75)); }
}
@keyframes iconIn { from{ opacity:0; transform: translateY(10px) rotate(-20deg) scale(0.6);} to{ opacity:1; transform: translateY(0) rotate(0) scale(1);} }
.auth-brand-name { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.auth-brand-accent { color: #7de3ff; }
[data-theme="light"] .auth-brand-accent, body.light-theme .auth-brand-accent { color: #e0f2fe; }

.auth-visual-title { font-size: 2.4rem; font-weight: 800; line-height: 1.18; letter-spacing: -0.02em; margin-bottom: 1rem; animation: fadeUp 0.7s 0.1s both; }
.auth-visual-sub { font-size: 1.05rem; line-height: 1.6; color: rgba(255,255,255,0.82); margin-bottom: 2rem; animation: fadeUp 0.7s 0.25s both; }
.auth-feature-list { list-style: none; padding: 0; margin: 0 0 2.5rem; display: flex; flex-direction: column; gap: 0.9rem; }
.auth-feature-list li { display: flex; align-items: center; gap: 12px; font-size: 0.95rem; color: rgba(255,255,255,0.9); }
.auth-feat-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2); font-size: 0.85rem; }
@keyframes fadeUp { from{ opacity:0; transform: translateY(18px);} to{ opacity:1; transform: translateY(0);} }


/* ========== RIGHT FORM SIDE ========== */
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 400px; animation: cardIn 0.6s cubic-bezier(0.16,1,0.3,1) both; }
@keyframes cardIn { from{ opacity:0; transform: translateX(28px);} to{ opacity:1; transform: translateX(0);} }

.auth-tabs { position: relative; display: flex; background: var(--glass-input); border: 1px solid var(--glass-border); border-radius: var(--radius-full); padding: 5px; margin-bottom: 2rem; }
.auth-tab { flex: 1; z-index: 1; padding: 0.6rem; border: none; background: none; cursor: pointer; font-size: 0.9rem; font-weight: 700; color: var(--text-muted); border-radius: var(--radius-full); transition: color 0.25s ease; font-family: inherit; }
.auth-tab.active { color: #fff; }
[data-theme="light"] .auth-tab.active, body.light-theme .auth-tab.active { color: #fff; }
.auth-tab-glider { position: absolute; top: 5px; left: 5px; width: calc(50% - 5px); height: calc(100% - 10px); border-radius: var(--radius-full); background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); transition: transform 0.3s cubic-bezier(0.16,1,0.3,1); box-shadow: 0 4px 14px rgba(0,150,199,0.4); }
.auth-tab-glider.right { transform: translateX(100%); }

.auth-head { margin-bottom: 1.75rem; }
.auth-head h1 { font-size: 1.7rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; margin-bottom: 0.35rem; }
.auth-head p { font-size: 0.92rem; color: var(--text-secondary); }

.auth-form { display: flex; flex-direction: column; gap: 1.15rem; }
.auth-field { display: flex; flex-direction: column; gap: 0.5rem; }
.auth-field label { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.auth-field label i { color: var(--primary-color); font-size: 0.9rem; }
.auth-field input {
    width: 100%; padding: 0.85rem 1rem; border-radius: var(--radius-md);
    border: 1.5px solid var(--glass-border); background: var(--glass-input); color: var(--text-primary);
    font-size: 0.95rem; font-family: inherit; transition: var(--transition);
}
.auth-field input::placeholder { color: var(--text-muted); }
.auth-field input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3.5px var(--cyan-glow-dim, rgba(0,212,255,0.16)); }

.auth-pass-wrap { position: relative; }
.auth-pass-wrap input { padding-right: 3rem; }
.auth-eye { position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 8px; font-size: 0.9rem; transition: color 0.2s; }
.auth-eye:hover { color: var(--primary-color); }

.auth-submit {
    width: 100%; padding: 0.95rem; margin-top: 0.4rem; border: none; border-radius: var(--radius-md);
    background: var(--fill-primary); color: var(--on-fill);
    font-size: 1rem; font-weight: 700; cursor: pointer; font-family: inherit;
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    box-shadow: 0 10px 24px rgba(0,150,199,0.35); transition: var(--transition);
}
.auth-submit:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0,150,199,0.5); background: var(--fill-primary-hover); }
.auth-submit:active { transform: translateY(0); }

.auth-signup-note { font-size: 0.85rem; line-height: 1.45; text-align: center; margin: 0; color: var(--primary-color); }
.auth-signup-note.show { margin-top: 0.1rem; }
.auth-signup-note.is-error { color: var(--error-color); }

/* --- Signup steps --- */
.su-step { display: flex; flex-direction: column; gap: 1rem; }
/* An explicit `display` beats the browser's built-in [hidden] rule, so without
   this every step renders at once and el.hidden appears to do nothing. */
.su-step[hidden] { display: none !important; }
.su-sent { font-size: 0.86rem; line-height: 1.5; text-align: center; color: var(--text-secondary); margin: 0; }
.su-sent strong { color: var(--text-primary); word-break: break-all; }
.su-verified {
    display: flex; align-items: center; gap: 9px;
    padding: 0.65rem 0.85rem; border-radius: var(--radius-md);
    background: rgba(6, 214, 160, 0.1); border: 1px solid rgba(6, 214, 160, 0.3);
    font-size: 0.83rem;
}
.su-verified i { color: var(--success-color); flex: none; font-size: 0.9rem; }
.su-verified-email {
    color: var(--text-primary); min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Pushed to the right edge so the address reads as the content and the status
   as a label on it, rather than the two running together mid-sentence. */
.su-verified-tag {
    margin-left: auto; flex: none;
    color: var(--success-color); font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.05em; text-transform: uppercase;
}

/* The code is six characters, so it is spaced out and centred rather than
   sitting in a full-width field like an email address. */
.su-code-input {
    text-align: center;
    font-size: 1.4rem !important;
    font-weight: 700;
    letter-spacing: 0.5em;
    text-indent: 0.5em;   /* re-centres text that letter-spacing pushes left */
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.su-links { display: flex; align-items: center; justify-content: center; gap: 1.25rem; }
.su-link {
    border: none; background: none; padding: 0; cursor: pointer;
    font-family: inherit; font-size: 0.78rem; color: var(--text-muted);
    transition: var(--transition);
}
.su-link:hover { color: var(--primary-color); }
.auth-submit:disabled { opacity: 0.65; cursor: default; transform: none; }

/* --- Google sign-in --- */
.auth-divider { display: flex; align-items: center; gap: 0.9rem; margin: 1.35rem 0 1.1rem; }
.auth-divider::before, .auth-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--glass-border);
}
.auth-divider span { font-size: 0.76rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

.auth-google-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 0.75rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--glass-input);
    color: var(--text-primary);
    font-size: 0.9rem; font-weight: 600; text-decoration: none;
    transition: var(--transition);
}
.auth-google-btn:hover {
    border-color: var(--primary-color);
    background: var(--glass-bg-hover);
    transform: translateY(-1px);
}
.auth-google-btn svg { flex: none; }
@media (prefers-reduced-motion: reduce) { .auth-google-btn:hover { transform: none; } }
.auth-signup-note.show { color: var(--primary-color); }
.auth-foot { text-align: center; font-size: 0.8rem; color: var(--text-muted); margin-top: 2rem; }


/* Feature list as sequential typing lines */
.auth-feature-list li { position: relative; opacity: 0.35; transition: opacity 0.5s ease; }
.auth-feature-list li.done, .auth-feature-list li.typing { opacity: 1; }
.auth-feat-text { position: relative; }
.auth-feature-list li.typing .auth-feat-text::after {
    content: ''; display: inline-block; width: 7px; height: 1em; margin-left: 2px;
    background: #7de3ff; vertical-align: -2px; animation: caretBlink 1s step-end infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }
.auth-feature-list li.pop .auth-feat-ico { animation: featIconPop 0.5s cubic-bezier(0.16,1,0.3,1); }
@keyframes featIconPop { from { transform: scale(0.5) rotate(-15deg); opacity: 0.4; } to { transform: scale(1) rotate(0); opacity: 1; } }

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .auth-form-side { padding: 1.5rem; }
}

/* ==========================================================================
   INVITATION
   ========================================================================== */

/* The plan and seats of the account doing the inviting. */
.invite-facts {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: rgba(0, 212, 255, 0.06);
}
body.light-theme .invite-facts {
    background: rgba(2, 132, 199, 0.06);
    border-color: rgba(2, 132, 199, 0.2);
}
.invite-fact { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.invite-fact-label { font-size: 0.82rem; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.invite-fact-value { font-size: 0.86rem; font-weight: 700; color: var(--text-primary); }

/* A link that cannot be used, and the mismatched-identity warning. */
.invite-dead {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    margin-bottom: 20px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
}
.invite-dead i { font-size: 1.1rem; color: var(--text-muted); margin-top: 2px; }
.invite-dead p { margin: 0; font-size: 0.86rem; line-height: 1.55; color: var(--text-secondary); }
.invite-warn { border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.08); }
.invite-warn i { color: #f59e0b; }

/* .auth-submit is styled for <button>; these are anchors doing the same job. */
.invite-plain-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

.invite-note {
    margin: 16px 0 0;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-secondary);
    text-align: center;
}

.invite-error {
    margin: 4px 0 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm, 8px);
    font-size: 0.82rem;
    color: #fecaca;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
}
body.light-theme .invite-error { color: #991b1b; background: rgba(239, 68, 68, 0.08); }
