:root {
    --bg-dark: #131722;
    --bg-card: #1c2030;
    --border-color: #2a2e39;
    --text-muted: #848e9c;
    --text-light: #d1d4dc;
    --accent-blue: #2979ff;
    --accent-gold: #dfb15b;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    background-color: var(--bg-dark);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text-light);
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Two soft, slowly-drifting glow blobs behind the whole page - gives the
   dark background some life without competing with the form for attention. */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.16;
}

body::before {
    top: -180px;
    left: -160px;
    background: var(--accent-blue);
    animation: authBlobDrift1 16s ease-in-out infinite;
}

body::after {
    bottom: -200px;
    right: -160px;
    background: var(--accent-gold);
    animation: authBlobDrift2 18s ease-in-out infinite;
}

@keyframes authBlobDrift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, 40px) scale(1.12); }
}

@keyframes authBlobDrift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-50px, -30px) scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
    body::before, body::after,
    .auth-right-art, .auth-card,
    .auth-marketing h2 span { animation: none !important; }

    /* These are entrance animations starting from a hidden state (scaleY(0),
       full dash-offset, opacity:0) - disabling the animation without also
       setting the end state would leave the whole chart invisible. */
    .auth-chart-bar { animation: none !important; transform: scaleY(1) !important; }
    .auth-chart-line { animation: none !important; stroke-dashoffset: 0 !important; }
    .auth-chart-dot { animation: none !important; opacity: 1 !important; }
}

/* Two-panel layout: a fixed-width login form column on the left, with the
   marketing/feature pitch filling the rest of the screen. The right panel
   drops out below 900px - there's no room to keep both readable, so the
   form gets the full width on small screens instead. */
.auth-left {
    flex: 0 0 460px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.auth-right {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-dark) 100%);
    border-left: 1px solid var(--border-color);
    overflow: hidden;
    padding: 60px;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .auth-left { flex: 1; }
    .auth-right { display: none; }
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    animation: authCardIn 0.5s ease both;
}

@keyframes authCardIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 40px;
}

.auth-brand svg {
    font-size: 3.2rem;
}

/* Custom gold-bar + book logo - width/height:1em obeys whichever font-size
   its context sets, the same way an icon font glyph would. */
.logo-mark {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -0.15em;
    flex-shrink: 0;
}

.auth-brand span {
    font-size: 2.1rem;
    font-weight: 700;
    color: #ffffff;
}

/* Right panel: sells the product - headline, pitch, and a feature list, with
   faint oversized brand art bleeding off the edges as background texture. */
.auth-marketing {
    position: relative;
    z-index: 1;
    max-width: 420px;
}

.auth-marketing h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 14px;
    line-height: 1.25;
}

.auth-marketing h2 span {
    background: linear-gradient(100deg, var(--accent-gold) 40%, #fff2d1 50%, var(--accent-gold) 60%);
    background-size: 220% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: authShimmer 3.5s ease-in-out 1s infinite;
}

@keyframes authShimmer {
    0%, 30% { background-position: 100% 0; }
    70%, 100% { background-position: -20% 0; }
}

.auth-marketing p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 32px;
}

.auth-feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 8px;
    margin: -8px;
    border-radius: 12px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.auth-feature-list li:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}

.auth-feature-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(223, 177, 91, 0.12);
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-feature-list li:hover .auth-feature-icon {
    background: var(--accent-gold);
    color: #131722;
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(223, 177, 91, 0.35);
}

.auth-feature-title {
    display: block;
    font-weight: 700;
    color: #ffffff;
    font-size: 0.92rem;
    margin-bottom: 2px;
}

.auth-feature-desc {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.auth-right-art {
    position: absolute;
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
    transition: translate 0.15s ease-out;
}

.auth-right-art-candles {
    bottom: -30px;
    left: -30px;
    width: 200px;
    height: auto;
    animation: authFloat 7s ease-in-out infinite;
}

/* An ascending gold bar chart + trend line - mirrors the app's own equity
   curve/stats charts, so the marketing art actually looks like the product
   instead of an unrelated object. */
.auth-right-art-bar {
    top: 30px;
    right: -10px;
    width: 200px;
    height: auto;
    opacity: 0.5;
    animation: authFloat 8s ease-in-out infinite 0.5s;
}

.auth-chart-bar {
    transform-origin: bottom;
    transform: scaleY(0);
    animation: authBarGrow 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.auth-chart-bar:nth-of-type(1) { animation-delay: 0.1s; }
.auth-chart-bar:nth-of-type(2) { animation-delay: 0.22s; }
.auth-chart-bar:nth-of-type(3) { animation-delay: 0.34s; }
.auth-chart-bar:nth-of-type(4) { animation-delay: 0.46s; }
.auth-chart-bar:nth-of-type(5) { animation-delay: 0.58s; }

@keyframes authBarGrow {
    to { transform: scaleY(1); }
}

.auth-chart-line {
    stroke-dasharray: 210;
    stroke-dashoffset: 210;
    animation: authLineDraw 1s ease-out 0.9s forwards;
}

@keyframes authLineDraw {
    to { stroke-dashoffset: 0; }
}

.auth-chart-dot {
    opacity: 0;
    transform-origin: center;
    animation: authDotIn 0.3s ease 1.8s forwards, authDotPulse 2s ease-in-out 2.1s infinite;
}

@keyframes authDotIn {
    to { opacity: 1; }
}

@keyframes authDotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.5); }
}

.auth-right-art-bar-glow {
    position: absolute;
    top: -40px;
    right: -60px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(223, 177, 91, 0.28) 0%, rgba(223, 177, 91, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

@keyframes authFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

.auth-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 28px;
}

.auth-btn-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 13px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.auth-btn-google:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.auth-btn-google:active {
    transform: translateY(0);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-field {
    margin-bottom: 18px;
}

.auth-field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.auth-forgot-link {
    font-size: 0.8rem;
    color: var(--accent-blue);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease;
}

.auth-forgot-link:hover {
    text-decoration: underline;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
    transition: color 0.15s ease;
}

.auth-input-wrap:focus-within .auth-input-icon {
    color: var(--accent-blue);
}

.auth-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 13px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-input.has-icon {
    padding-left: 42px;
}

.auth-input.has-toggle {
    padding-right: 42px;
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(41, 121, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(41, 121, 255, 0.14);
}

.auth-input-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.auth-input-toggle:hover {
    color: var(--text-light);
}

/* Edge/IE ship their own built-in password reveal icon, which would sit
   right on top of our custom toggle button - hide theirs. */
.auth-input::-ms-reveal,
.auth-input::-ms-clear {
    display: none;
}

.auth-btn-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent-blue);
    border: none;
    color: #ffffff;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    box-sizing: border-box;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.auth-btn-submit:hover {
    background: #1f63d6;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(41, 121, 255, 0.35);
}

.auth-btn-submit:active {
    transform: translateY(0);
    box-shadow: none;
}

.auth-btn-submit:disabled {
    opacity: 0.7;
    cursor: default;
    transform: none;
    box-shadow: none;
}

.auth-btn-submit .fa-spinner {
    animation: authSpin 0.7s linear infinite;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

.auth-footer {
    text-align: center;
    margin-top: 22px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-footer a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-skip-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: none;
    cursor: pointer;
}

.auth-skip-link:hover {
    color: var(--text-light);
    text-decoration: underline;
}

.auth-error {
    display: none;
    background: rgba(246, 70, 93, 0.1);
    border: 1px solid #f6465d;
    color: #f6465d;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    margin-bottom: 18px;
}
