/* ============================================================
   TradeJournal — Auth (Login / Sign up) Stylesheet
   Design system: Supabaze spec (white canvas, emerald accent)
   Relies on CSS variables defined in main.css (:root)
   ============================================================ */

/* ============================================================
   1. VIEW SHELL
   ============================================================ */
.auth-view {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f7f7f7;
    border: 1px solid var(--hairline-cool-3);
}

.auth-view.is-hidden {
    display: none;
}

/* Hide dashboard app shell while auth view is active */
.app.is-hidden {
    display: none;
}

/* ============================================================
   2. FORM PANEL — centered single column
   ============================================================ */
.auth-panel {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--s-xxl) var(--s-xxl) 0;
}

.auth-panel__inner {
    width: 100%;
    max-width: 386px;
    margin: 132px auto 0;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    position: absolute;
    top: var(--s-xxl);
    left: var(--s-xxl);
}

.auth-brand .brand-mark {
    width: 24px;
    height: 24px;
    flex: none;
    background: var(--primary);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-brand .brand-mark svg {
    width: 13px;
    height: 13px;
    stroke: var(--on-primary);
    fill: none;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-brand .brand-name {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.4px;
    color: var(--ink);
}

.auth-brand .brand-name span {
    color: var(--primary-deep);
}

.auth-heading {
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -0.5px;
    line-height: 1.2;
    color: var(--ink);
    margin-bottom: var(--s-xs);
}

.auth-subheading {
    font-size: 14px;
    color: var(--ink-mute);
    margin-bottom: var(--s-xxl);
}

/* ── OAuth buttons ─────────────────────────────────────────── */
.auth-oauth {
    display: flex;
    flex-direction: column;
    gap: var(--s-sm);
    margin-bottom: var(--s-lg);
}

.auth-btn-oauth {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 42px;
    background: #f7f7f7;
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 400;
    border-radius: var(--r-sm);
    border: 1px solid #d4d4d4;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease;
}

.auth-btn-oauth:hover {
    background: #f1f1f1;
    border-color: var(--ink-mute-2);
}

.auth-btn-oauth svg,
.auth-btn-oauth img {
    width: 16px;
    height: 16px;
    flex: none;
}

/* ── Divider ───────────────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--s-md);
    margin: var(--s-lg) 0;
    color: var(--ink-mute);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #d4d4d4;
}

/* ── Form ──────────────────────────────────────────────────── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--s-lg);
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: var(--s-xs);
}

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

.auth-label {
    font-size: 13px;
    font-weight: 400;
    color: var(--ink);
}

.auth-label-optional {
    font-size: 12px;
    font-weight: 400;
    color: var(--ink-mute);
    margin-left: 2px;
}

.auth-forgot {
    font-size: 13px;
    color: var(--ink);
    text-decoration: none;
}

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

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

.auth-input {
    width: 100%;
    height: 40px;
    padding: 0 var(--s-md);
    background: #f1f1f1;
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    border-radius: var(--r-sm);
    border: 1px solid #d4d4d4;
    transition: border-color 120ms ease;
}

.auth-input::placeholder {
    color: var(--ink-faint);
}

.auth-input:focus {
    outline: none;
    border-color: var(--ink-mute-2);
}

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

.auth-pw-toggle {
    position: absolute;
    top: 4px;
    right: 4px;
    bottom: 4px;
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-mute);
    background: #f7f7f7;
    border: 1px solid #d4d4d4;
    border-radius: 4px;
    cursor: pointer;
}

.auth-pw-toggle svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Submit button ─────────────────────────────────────────── */
.auth-btn-submit {
    width: 100%;
    height: 42px;
    margin-top: var(--s-xs);
    background: #6ee7a7;
    color: var(--on-primary);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--r-sm);
    border: 1px solid #5cd494;
    cursor: pointer;
    box-shadow: 0 0 0 2px rgba(110, 231, 167, 0.12), 0 2px 8px rgba(85, 179, 132, 0.18);
    transition: background 120ms ease, box-shadow 120ms ease;
}

.auth-btn-submit:hover {
    background: #5cd494;
    box-shadow: 0 0 0 3px rgba(110, 231, 167, 0.16), 0 3px 10px rgba(85, 179, 132, 0.25);
}

.auth-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

/* ── Switch view (sign in / sign up) ──────────────────────────*/
.auth-switch {
    margin-top: var(--s-xxl);
    text-align: center;
    font-size: 13px;
    color: var(--ink);
}

.auth-switch-link {
    color: var(--ink);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--font);
    font-size: 13px;
}

/* ── Legal note ────────────────────────────────────────────── */
.auth-legal {
    margin-top: var(--s-huge);
    margin-bottom: var(--s-xxl);
    padding-bottom: var(--s-xxl);
    text-align: center;
    font-size: 12px;
    line-height: 1.45;
    color: var(--ink-mute-2);
}

.auth-legal a {
    text-decoration: underline;
}

.auth-legal a:hover {
    color: var(--ink-mute);
}

/* ── Inline status / error message ────────────────────────── */
.auth-message {
    display: none;
    padding: var(--s-sm) var(--s-md);
    border-radius: var(--r-sm);
    font-size: 13px;
    line-height: 1.4;
}

.auth-message.is-visible {
    display: block;
}

.auth-message--error {
    background: #fdecec;
    color: #b3261e;
    border: 1px solid #f5c2c0;
}

.auth-message--success {
    background: #e9fbf2;
    color: var(--primary-deep);
    border: 1px solid var(--primary-soft);
}

/* ============================================================
   3. DOCUMENTATION LINK — fixed top-right of the view
   ============================================================ */
.auth-showcase__doc-link {
    position: absolute;
    top: var(--s-xxl);
    right: var(--s-xxl);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 var(--s-md);
    background: var(--canvas);
    color: var(--ink);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--r-sm);
    border: 1px solid var(--hairline-cool-3);
}

.auth-showcase__doc-link svg {
    width: 14px;
    height: 14px;
    stroke: var(--ink-mute);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============================================================
   4. RESPONSIVE
   ============================================================ */
@media (max-width: 1023px) {
    .auth-panel {
        padding: var(--s-xxl) var(--s-xl);
    }
}

@media (max-width: 480px) {
    .auth-heading {
        font-size: 22px;
    }
}