@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --auth-primary: #465fff;
    --auth-primary-dark: #3549d1;
    --auth-primary-soft: rgba(70, 95, 255, 0.08);
    --auth-surface: #f8fafc;
    --auth-surface-strong: #ffffff;
    --auth-surface-muted: #f8fafc;
    --auth-border: #e2e8f0;
    --auth-border-soft: #eef2f7;
    --auth-text: #0f172a;
    --auth-text-muted: #64748b;
    --auth-text-soft: #94a3b8;
    --auth-success-bg: #f0fdf4;
    --auth-success-border: #bbf7d0;
    --auth-success-text: #166534;
    --auth-error-bg: #fef2f2;
    --auth-error-border: #fecaca;
    --auth-error-text: #b91c1c;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body.auth-stitch-body {
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--auth-surface);
    color: var(--auth-text);
    position: relative;
    overflow-x: hidden;
}

body.auth-stitch-body::before,
body.auth-stitch-body::after {
    content: "";
    position: fixed;
    inset: auto;
    border-radius: 999px;
    pointer-events: none;
    z-index: 0;
    filter: blur(80px);
}

body.auth-stitch-body::before {
    width: 18rem;
    height: 18rem;
    top: 8%;
    left: 10%;
    background: rgba(70, 95, 255, 0.09);
}

body.auth-stitch-body::after {
    width: 24rem;
    height: 24rem;
    right: 4%;
    bottom: 6%;
    background: rgba(70, 95, 255, 0.12);
}

.auth-stitch-page {
    min-height: 100vh;
    padding: 24px 16px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.auth-stitch-main {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.auth-card {
    background: var(--auth-surface-strong);
    border: 1px solid var(--auth-border-soft);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 30px 70px -46px rgba(15, 23, 42, 0.45);
    position: relative;
    overflow: hidden;
}

.auth-card::after {
    content: "";
    position: absolute;
    top: -56px;
    right: -48px;
    width: 132px;
    height: 132px;
    border-radius: 999px;
    background: rgba(70, 95, 255, 0.07);
    filter: blur(18px);
    pointer-events: none;
}

.auth-brand {
    margin-bottom: 24px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.auth-brand__logo {
    width: min(240px, 72%);
    height: auto;
    display: inline-block;
}

.auth-title {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.1;
    letter-spacing: -0.04em;
    font-weight: 800;
    color: var(--auth-text);
}

.auth-subtitle {
    margin: 0;
    color: var(--auth-text-muted);
    font-size: 14px;
    line-height: 1.6;
    font-weight: 500;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-field__label {
    margin: 0;
    color: var(--auth-text-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

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

.auth-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-text-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: color 0.2s ease;
}

.auth-input {
    width: 100%;
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    background: var(--auth-surface-muted);
    padding: 14px 16px 14px 48px;
    font: inherit;
    color: var(--auth-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-input--with-toggle {
    padding-right: 88px;
}

.auth-input::placeholder {
    color: var(--auth-text-soft);
}

.auth-input:focus {
    outline: none;
    background: #ffffff;
    border-color: rgba(70, 95, 255, 0.5);
    box-shadow: 0 0 0 4px rgba(70, 95, 255, 0.14);
}

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

.auth-icon-button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    background: transparent;
    color: var(--auth-text-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 8px;
}

.auth-icon-button:hover {
    color: var(--auth-primary);
}

.auth-link-row {
    display: flex;
    justify-content: flex-end;
}

.auth-mode-switch {
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 6px;
    border-radius: 18px;
    background: var(--auth-surface-muted);
    border: 1px solid var(--auth-border-soft);
}

.auth-mode-button {
    border: none;
    border-radius: 14px;
    padding: 12px 14px;
    background: transparent;
    color: var(--auth-text-muted);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.auth-mode-button__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-mode-button.is-active {
    background: #ffffff;
    color: var(--auth-primary);
    box-shadow: 0 12px 24px -28px rgba(15, 23, 42, 0.85);
}

.auth-mode-pane.is-hidden {
    display: none;
}

.auth-pane-copy {
    margin: 0 0 16px;
    color: var(--auth-text-muted);
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
    font-weight: 600;
}

.auth-pane-copy--left {
    text-align: left;
}

.auth-inline-link {
    color: var(--auth-primary);
    font-weight: 800;
    text-decoration: none;
}

.auth-inline-link:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

.auth-inline-link--small {
    font-size: 12px;
}

.auth-link {
    color: var(--auth-primary);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

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

.auth-primary-button,
.auth-secondary-button {
    width: 100%;
    border: none;
    border-radius: 16px;
    padding: 15px 18px;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.auth-primary-button {
    background: var(--auth-primary);
    color: #ffffff;
    box-shadow: 0 18px 30px -24px rgba(70, 95, 255, 0.95);
}

.auth-primary-button:hover,
.auth-primary-button:focus-visible {
    background: var(--auth-primary-dark);
    transform: translateY(-1px);
}

.auth-primary-button:disabled {
    opacity: 0.8;
    cursor: wait;
}

.auth-secondary-button,
.auth-ghost-link {
    background: #ffffff;
    color: var(--auth-text);
    border: 1px solid var(--auth-border);
    box-shadow: 0 12px 24px -28px rgba(15, 23, 42, 0.65);
}

.auth-secondary-button:hover,
.auth-ghost-link:hover {
    border-color: rgba(70, 95, 255, 0.32);
    color: var(--auth-primary);
    transform: translateY(-1px);
}

.auth-secondary-panel {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--auth-border-soft);
    position: relative;
    z-index: 1;
}

.auth-secondary-panel__copy {
    margin: 0 0 14px;
    text-align: center;
    color: var(--auth-text-muted);
    font-size: 14px;
    line-height: 1.5;
    font-weight: 600;
}

.auth-secondary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.auth-ghost-link {
    border-radius: 16px;
    padding: 13px 14px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.auth-message,
.auth-validation-summary,
.validation-summary-errors {
    margin-top: 16px;
    border-radius: 16px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 700;
}

.auth-message--error,
.auth-validation-summary,
.validation-summary-errors {
    background: var(--auth-error-bg);
    border: 1px solid var(--auth-error-border);
    color: var(--auth-error-text);
}

.auth-message--success {
    background: var(--auth-success-bg);
    border: 1px solid var(--auth-success-border);
    color: var(--auth-success-text);
}

.validation-summary-valid {
    display: none;
}

.validation-summary-errors ul,
.auth-validation-summary ul {
    margin: 0;
    padding-left: 18px;
}

.field-validation-error {
    color: var(--auth-error-text);
    font-size: 13px;
    font-weight: 700;
}

.field-validation-valid {
    display: none;
}

.input-validation-error {
    border-color: var(--auth-error-border);
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.12);
}

.auth-note-card {
    margin-top: 24px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: rgba(70, 95, 255, 0.06);
    border: 1px solid rgba(70, 95, 255, 0.12);
    border-radius: 18px;
    padding: 16px;
    position: relative;
    z-index: 1;
}

.auth-note-card__icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 14px;
    background: #ffffff;
    color: var(--auth-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px -18px rgba(70, 95, 255, 0.8);
}

.auth-note-card__eyebrow {
    margin: 0 0 4px;
    color: #1e3a8a;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-note-card__text {
    margin: 0;
    color: #1e40af;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 600;
}

.auth-insight-card {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--auth-border-soft);
    position: relative;
    z-index: 1;
}

.auth-insight-card__inner {
    border-radius: 18px;
    background: var(--auth-surface-muted);
    padding: 16px;
    border: 1px solid var(--auth-border-soft);
}

.auth-insight-card__eyebrow {
    margin: 0 0 3px;
    color: var(--auth-text-muted);
    font-size: 12px;
    font-weight: 700;
}

.auth-insight-card__text {
    margin: 0;
    color: var(--auth-text);
    font-size: 13px;
    line-height: 1.45;
    font-weight: 800;
}

.auth-insight-card__meta {
    margin: 10px 0 0;
    color: var(--auth-text-muted);
    font-size: 12px;
    line-height: 1.5;
    font-weight: 700;
}

.auth-insight-card__actions {
    margin-top: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.auth-insight-card__actions .auth-insight-card__meta {
    margin: 0;
}

.auth-support-copy {
    margin: 14px 0 0;
    color: var(--auth-text-muted);
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}

.auth-rules {
    margin: 16px 0 0;
    padding-left: 18px;
    color: var(--auth-text-muted);
    font-size: 13px;
    line-height: 1.6;
    font-weight: 600;
}

.auth-rules li + li {
    margin-top: 6px;
}

.auth-footer {
    max-width: 640px;
    margin: 24px auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.auth-footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 24px;
}

.auth-footer__link {
    color: var(--auth-text-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-footer__link:hover {
    color: var(--auth-primary);
}

.auth-footer__copy {
    margin: 0;
    color: var(--auth-text-soft);
    font-size: 12px;
    font-weight: 600;
}

.is-hidden {
    display: none;
}

@media (max-width: 640px) {
    .auth-stitch-page {
        padding: 20px 12px 28px;
    }

    .auth-card {
        padding: 28px 20px;
        border-radius: 20px;
    }

    .auth-title {
        font-size: 26px;
    }

    .auth-secondary-grid {
        grid-template-columns: 1fr;
    }

    .auth-mode-switch {
        grid-template-columns: 1fr;
    }

    .auth-footer__links {
        gap: 12px 18px;
    }
}
