/* =========================================================
   ARBITRAGE AI V2
   Authentication interface
   Based on the approved UI render
   ========================================================= */

:root {
    --auth-bg: #0B1220;
    --auth-panel: #111827;
    --auth-card: #1F2937;
    --auth-border: #374151;
    --auth-primary: #16A34A;
    --auth-primary-hover: #22C55E;
    --auth-blue: #2563EB;
    --auth-text: #F9FAFB;
    --auth-muted: #9CA3AF;
    --auth-danger: #EF4444;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body.auth-page {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--auth-text);
    background:
        radial-gradient(
            circle at 15% 46%,
            rgba(22, 163, 74, 0.07),
            transparent 29%
        ),
        radial-gradient(
            circle at 80% 15%,
            rgba(37, 99, 235, 0.035),
            transparent 34%
        ),
        #070E19;
    font-family:
        Inter,
        ui-sans-serif,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

.auth-page-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.auth-page-background::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.17;
    background-image:
        linear-gradient(
            rgba(55, 65, 81, 0.12) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(55, 65, 81, 0.12) 1px,
            transparent 1px
        );
    background-size: 42px 42px;
    mask-image:
        radial-gradient(
            ellipse at center,
            black 10%,
            transparent 78%
        );
}

.auth-page-background::after {
    content: "";
    position: absolute;
    top: -420px;
    left: 50%;
    width: 920px;
    height: 920px;
    border: 1px solid rgba(34, 197, 94, 0.035);
    border-radius: 999px;
    transform: translateX(-50%);
    box-shadow:
        0 0 0 120px rgba(34, 197, 94, 0.012),
        0 0 0 240px rgba(34, 197, 94, 0.008);
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: min(1200px, calc(100% - 48px));
    min-height: 700px;
    margin: 24px auto;
    display: grid;
    grid-template-columns: minmax(390px, 0.88fr) minmax(430px, 1.12fr);
    overflow: hidden;
    border: 1px solid rgba(55, 65, 81, 0.92);
    border-radius: 14px;
    background: rgba(11, 18, 32, 0.96);
    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.018);
}

/* =========================================================
   HERO PANEL
   ========================================================= */

.auth-hero {
    position: relative;
    min-height: 700px;
    padding: 34px 34px 30px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid rgba(55, 65, 81, 0.78);
    background:
        radial-gradient(
            circle at 88% 50%,
            rgba(22, 163, 74, 0.12),
            transparent 40%
        ),
        linear-gradient(
            160deg,
            rgba(17, 24, 39, 0.98),
            rgba(8, 15, 27, 0.98)
        );
}

.auth-hero::before {
    content: "";
    position: absolute;
    right: -205px;
    top: 72px;
    width: 480px;
    height: 480px;
    border: 1px solid rgba(34, 197, 94, 0.13);
    border-radius: 999px;
    box-shadow:
        0 0 70px rgba(22, 163, 74, 0.06),
        inset 0 0 60px rgba(22, 163, 74, 0.025);
}

.auth-hero::after {
    content: "";
    position: absolute;
    right: -155px;
    top: 122px;
    width: 380px;
    height: 380px;
    border: 1px solid rgba(34, 197, 94, 0.07);
    border-radius: 999px;
}

.auth-brand {
    position: relative;
    z-index: 6;
    width: 207px;
}

.auth-hero-copy {
    position: relative;
    z-index: 5;
    max-width: 305px;
    margin-top: 60px;
}

.auth-hero-title {
    margin: 0;
    color: var(--auth-text);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.032em;
}

.auth-hero-title-accent {
    display: block;
    margin-top: 4px;
    color: var(--auth-primary-hover);
}

.auth-hero-tagline {
    margin: 22px 0 0;
    color: #D1D5DB;
    font-size: 14px;
    font-weight: 500;
}

.auth-hero-description {
    max-width: 258px;
    margin: 12px 0 0;
    color: var(--auth-muted);
    font-size: 12px;
    line-height: 1.72;
}

.auth-benefits {
    position: relative;
    z-index: 6;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.auth-benefit {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #D1D5DB;
    font-size: 12px;
}

.auth-benefit-icon {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    flex: 0 0 18px;
    color: var(--auth-primary-hover);
}

.auth-benefit-icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-globe-wrap {
    position: absolute;
    z-index: 3;
    top: 48px;
    right: -42px;
    width: 420px;
    height: 560px;
    pointer-events: none;
}

.auth-globe-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* =========================================================
   FORM PANEL
   ========================================================= */

.auth-form-panel {
    position: relative;
    min-height: 700px;
    padding: 34px 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(
            180deg,
            rgba(13, 21, 35, 0.99),
            rgba(9, 16, 28, 0.99)
        );
}

.auth-form-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(
            circle at 50% 32%,
            rgba(22, 163, 74, 0.025),
            transparent 44%
        );
}

.auth-form-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 390px;
}

.auth-mobile-logo {
    width: 190px;
    margin: 0 auto 42px;
    display: none;
}

.auth-form-heading {
    margin-bottom: 28px;
    text-align: center;
}

.auth-form-heading h1 {
    margin: 0;
    color: var(--auth-text);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.024em;
}

.auth-form-heading p {
    margin: 6px 0 0;
    color: var(--auth-muted);
    font-size: 12px;
}

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

.auth-field-label-row {
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-label {
    color: #D1D5DB;
    font-size: 12px;
    font-weight: 500;
}

.auth-label-link {
    color: var(--auth-primary-hover);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
}

.auth-label-link:hover {
    color: #4ADE80;
}

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

.auth-input {
    width: 100%;
    height: 42px;
    padding: 0 13px;
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    outline: none;
    color: var(--auth-text);
    background:
        linear-gradient(
            180deg,
            rgba(17, 24, 39, 0.98),
            rgba(13, 20, 32, 0.98)
        );
    font: inherit;
    font-size: 12px;
    transition:
        border-color 140ms ease,
        box-shadow 140ms ease,
        background 140ms ease;
}

.auth-input::placeholder {
    color: #6B7280;
}

.auth-input:hover {
    border-color: #4B5563;
}

.auth-input:focus {
    border-color: var(--auth-primary);
    background: var(--auth-panel);
    box-shadow:
        0 0 0 3px rgba(22, 163, 74, 0.11);
}

.auth-input-password {
    padding-right: 60px;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    min-width: 43px;
    height: 28px;
    padding: 0 7px;
    border: 0;
    border-radius: 5px;
    color: var(--auth-muted);
    background: transparent;
    font: inherit;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transform: translateY(-50%);
}

.auth-password-toggle:hover {
    color: var(--auth-primary-hover);
    background: rgba(22, 163, 74, 0.08);
}

.auth-options {
    min-height: 25px;
    margin: 1px 0 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #D1D5DB;
    font-size: 11px;
    cursor: pointer;
}

.auth-checkbox input {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--auth-primary);
}

.auth-submit {
    width: 100%;
    height: 42px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid var(--auth-primary);
    border-radius: 6px;
    color: #FFFFFF;
    background:
        linear-gradient(
            180deg,
            #22B64F 0%,
            #16A34A 100%
        );
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 7px 18px rgba(22, 163, 74, 0.13);
    transition:
        transform 140ms ease,
        border-color 140ms ease,
        background 140ms ease,
        box-shadow 140ms ease,
        opacity 140ms ease;
}

.auth-submit:hover:not(:disabled) {
    border-color: var(--auth-primary-hover);
    background:
        linear-gradient(
            180deg,
            #29C45A 0%,
            #22C55E 100%
        );
    box-shadow:
        0 10px 26px rgba(22, 163, 74, 0.2);
    transform: translateY(-1px);
}

.auth-submit:active:not(:disabled) {
    transform: translateY(0);
}

.auth-submit:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.auth-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.27);
    border-top-color: #FFFFFF;
    border-radius: 999px;
    animation: auth-spin 0.7s linear infinite;
}

.auth-message {
    min-height: 18px;
    margin-top: 10px;
    color: #F87171;
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
}

.auth-message.is-success {
    color: #4ADE80;
}

.auth-divider {
    margin: 18px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #6B7280;
    font-size: 10px;
    text-transform: lowercase;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(55, 65, 81, 0.85);
}

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

.auth-social-button {
    height: 40px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    color: #E5E7EB;
    background: rgba(17, 24, 39, 0.65);
    font: inherit;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition:
        border-color 140ms ease,
        background 140ms ease,
        transform 140ms ease;
}

.auth-social-button:hover {
    border-color: #4B5563;
    background: var(--auth-card);
    transform: translateY(-1px);
}

.auth-social-icon {
    width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
    font-size: 15px;
}

.auth-google-icon {
    font-family: Arial, sans-serif;
    font-weight: 700;
}

.auth-switch {
    margin-top: 20px;
    color: var(--auth-muted);
    font-size: 11px;
    text-align: center;
}

.auth-switch a {
    color: var(--auth-primary-hover);
    font-weight: 500;
    text-decoration: none;
}

.auth-switch a:hover {
    color: #4ADE80;
}

.auth-terms {
    margin: -1px 0 15px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--auth-muted);
    font-size: 10px;
    line-height: 1.5;
}

.auth-terms input {
    width: 14px;
    height: 14px;
    margin: 1px 0 0;
    flex: 0 0 14px;
    accent-color: var(--auth-primary);
}

.auth-terms a {
    color: var(--auth-primary-hover);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-register-card {
    max-width: 410px;
}

.auth-register-card .auth-form-heading {
    margin-bottom: 22px;
}

.auth-register-card .auth-field {
    margin-bottom: 12px;
}

.auth-register-card .auth-input {
    height: 40px;
}

.auth-register-card .auth-submit {
    height: 41px;
}

.auth-form-footer-note {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #6B7280;
    font-size: 10px;
}

.auth-footer-lock {
    width: 15px;
    height: 15px;
    display: grid;
    place-items: center;
    color: var(--auth-primary-hover);
}

.auth-footer-lock svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

/* =========================================================
   ANIMATION
   ========================================================= */

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes auth-fade-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form-card {
    animation: auth-fade-up 420ms ease both;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 980px) {
    .auth-shell {
        width: min(760px, calc(100% - 32px));
        grid-template-columns: 0.85fr 1.15fr;
    }

    .auth-hero {
        padding-left: 27px;
        padding-right: 27px;
    }

    .auth-hero-copy {
        max-width: 260px;
    }

    .auth-hero-title {
        font-size: 28px;
    }

    .auth-globe-wrap {
        right: -100px;
    }

    .auth-form-panel {
        padding-left: 36px;
        padding-right: 36px;
    }
}

@media (max-width: 760px) {
    body.auth-page {
        background: #080F1B;
    }

    .auth-shell {
        width: min(510px, calc(100% - 24px));
        min-height: calc(100vh - 24px);
        margin: 12px auto;
        display: block;
    }

    .auth-hero {
        display: none;
    }

    .auth-form-panel {
        min-height: calc(100vh - 24px);
        padding: 42px 32px;
    }

    .auth-mobile-logo {
        display: block;
    }
}

@media (max-width: 480px) {
    .auth-shell {
        width: 100%;
        min-height: 100vh;
        margin: 0;
        border: 0;
        border-radius: 0;
    }

    .auth-form-panel {
        min-height: 100vh;
        padding: 30px 21px;
        align-items: flex-start;
    }

    .auth-form-card {
        margin: auto 0;
    }

    .auth-mobile-logo {
        width: 178px;
        margin-bottom: 36px;
    }

    .auth-form-heading h1 {
        font-size: 23px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
