/* ==========================================================
   ASIN Intelligence
   Authentication Pages
   ========================================================== */

:root {
    --auth-bg: #07111f;
    --auth-bg-deep: #050d19;
    --auth-surface: #101d31;
    --auth-surface-soft: #14233a;
    --auth-border: #2a4773;
    --auth-border-soft: rgba(118, 154, 210, 0.18);

    --auth-text: #f6f8ff;
    --auth-text-soft: #b7c8e5;
    --auth-text-muted: #7f98bd;

    --auth-blue: #4e8cff;
    --auth-blue-strong: #3478f6;
    --auth-blue-soft: rgba(78, 140, 255, 0.14);

    --auth-green: #36d39a;
    --auth-green-soft: rgba(54, 211, 154, 0.12);

    --auth-red: #ff6b7a;
    --auth-red-soft: rgba(255, 107, 122, 0.11);

    --auth-yellow: #f4c95d;
    --auth-yellow-soft: rgba(244, 201, 93, 0.12);

    --auth-shadow: 0 28px 80px rgba(0, 0, 0, 0.3);
}


/* ==========================================================
   Reset
   ========================================================== */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: var(--auth-text);
    background:
        radial-gradient(
            circle at 15% 8%,
            rgba(78, 140, 255, 0.17),
            transparent 29rem
        ),
        radial-gradient(
            circle at 85% 12%,
            rgba(51, 181, 200, 0.08),
            transparent 27rem
        ),
        linear-gradient(
            180deg,
            var(--auth-bg),
            var(--auth-bg-deep)
        );
}

a {
    color: inherit;
    text-decoration: none;
}

input,
button {
    font: inherit;
}


/* ==========================================================
   Page Layout
   ========================================================== */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
}

.auth-shell {
    width: 100%;
    max-width: 520px;
}

.auth-card {
    position: relative;
    width: 100%;
    padding: 38px;
    border: 1px solid var(--auth-border);
    border-radius: 24px;
    background:
        linear-gradient(
            150deg,
            rgba(20, 35, 58, 0.98),
            rgba(9, 21, 37, 0.99)
        );
    box-shadow: var(--auth-shadow);
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background:
        linear-gradient(
            90deg,
            transparent,
            #4e8cff,
            #74b2ff,
            transparent
        );
}


/* ==========================================================
   Branding
   ========================================================== */

.auth-brand {
    text-align: center;
}

.auth-brand-link {
    display: inline-block;
}

.auth-brand-name {
    color: #ffffff;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.auth-brand-tagline {
    margin: 6px 0 0;
    color: var(--auth-text-muted);
    font-size: 11px;
}


/* ==========================================================
   Heading
   ========================================================== */

.auth-heading {
    margin-top: 30px;
    text-align: center;
}

.auth-heading h1 {
    margin: 0;
    color: #ffffff;
    font-size: 30px;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.auth-heading p {
    max-width: 390px;
    margin: 12px auto 0;
    color: var(--auth-text-soft);
    font-size: 13px;
    line-height: 1.65;
}


/* ==========================================================
   Flash Messages
   ========================================================== */

.auth-messages {
    margin-top: 22px;
    display: grid;
    gap: 10px;
}

.auth-alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.5;
}

.auth-alert-success {
    border: 1px solid rgba(54, 211, 154, 0.28);
    background: var(--auth-green-soft);
    color: #9cf2d2;
}

.auth-alert-error,
.auth-alert-danger {
    border: 1px solid rgba(255, 107, 122, 0.28);
    background: var(--auth-red-soft);
    color: #ffb6be;
}

.auth-alert-info {
    border: 1px solid rgba(78, 140, 255, 0.28);
    background: var(--auth-blue-soft);
    color: #bcd4ff;
}

.auth-alert-warning {
    border: 1px solid rgba(244, 201, 93, 0.28);
    background: var(--auth-yellow-soft);
    color: #f9df9c;
}


/* ==========================================================
   Form
   ========================================================== */

.auth-form {
    margin-top: 26px;
    display: grid;
    gap: 18px;
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-label {
    color: #dce7f8;
    font-size: 12px;
    font-weight: 800;
}

.form-input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #2d486f;
    border-radius: 11px;
    outline: none;
    background: rgba(6, 15, 27, 0.78);
    color: #ffffff;
    font-size: 13px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.form-input::placeholder {
    color: #607ba3;
}

.form-input:hover {
    border-color: #3a5c8d;
}

.form-input:focus {
    border-color: var(--auth-blue);
    background: rgba(8, 19, 34, 0.92);
    box-shadow: 0 0 0 3px rgba(78, 140, 255, 0.12);
}

.form-help {
    margin: 0;
    color: var(--auth-text-muted);
    font-size: 10px;
}


/* ==========================================================
   Validation Errors
   ========================================================== */

.field-errors {
    display: grid;
    gap: 4px;
}

.field-errors p {
    margin: 0;
    color: #ff9daa;
    font-size: 10px;
    line-height: 1.45;
}


/* ==========================================================
   Checkbox
   ========================================================== */

.form-checkbox-group {
    display: grid;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--auth-text-soft);
    font-size: 11px;
    line-height: 1.55;
    cursor: pointer;
}

.form-checkbox {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    flex-shrink: 0;
    accent-color: var(--auth-blue-strong);
}

.auth-inline-link {
    color: #9fc0ff;
    font-weight: 700;
}


/* ==========================================================
   Buttons
   ========================================================== */

.auth-primary-button,
.auth-secondary-button {
    width: 100%;
    min-height: 50px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.auth-primary-button {
    border: 1px solid rgba(115, 166, 255, 0.36);
    background:
        linear-gradient(
            135deg,
            #5795ff,
            var(--auth-blue-strong)
        );
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(52, 120, 246, 0.22);
}

.auth-primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(52, 120, 246, 0.3);
}

.auth-secondary-button {
    border: 1px solid #2c4770;
    background: rgba(11, 23, 40, 0.72);
    color: #d5e2f6;
}

.auth-secondary-button:hover {
    transform: translateY(-2px);
    border-color: #42679c;
    background: #14233a;
}


/* ==========================================================
   Divider
   ========================================================== */

.auth-divider {
    position: relative;
    margin: 26px 0 18px;
    text-align: center;
}

.auth-divider::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--auth-border-soft);
}

.auth-divider span {
    position: relative;
    padding: 0 12px;
    background: #0d1a2c;
    color: var(--auth-text-muted);
    font-size: 10px;
}


/* ==========================================================
   Footer Link
   ========================================================== */

.auth-back-link {
    margin: 20px 0 0;
    text-align: center;
}

.auth-back-link a {
    color: var(--auth-text-muted);
    font-size: 10px;
    transition: color 0.2s ease;
}

.auth-back-link a:hover {
    color: #ffffff;
}


/* ==========================================================
   Login-specific helpers
   ========================================================== */

.auth-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-text-soft);
    font-size: 11px;
}

.auth-text-link {
    color: #9fc0ff;
    font-size: 11px;
    font-weight: 700;
}

.auth-text-link:hover {
    color: #ffffff;
}


/* ==========================================================
   Responsive
   ========================================================== */

@media (max-width: 600px) {

    .auth-page {
        padding: 24px 14px;
    }

    .auth-card {
        padding: 30px 22px;
        border-radius: 18px;
    }

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

    .auth-form-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
}