/* ============================================================
   Auth Pages — Trendds AI
   Warm, editorial aesthetic with feature-rich brand panel
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ---- Design Tokens ---- */
:root {
    /* Surface */
    --auth-bg: #F5F4F0;
    --auth-card: #FBF9F7;
    --auth-panel: #1C120C;
    --auth-panel-text: #FAFAF8;
    --auth-panel-muted: rgba(250, 250, 248, 0.45);

    /* Pastel accents */
    --auth-peach: #F2CAAF;
    --auth-lavender: #CFC0E5;
    --auth-rose: #EBB0B9;
    --auth-sage: #A3C7AB;
    --auth-cream: #F3E2CB;

    /* Typography */
    --auth-text: #1A1816;
    --auth-text-secondary: #5C5955;
    --auth-text-muted: #9A9590;

    /* Form controls */
    --auth-input-bg: #FFFBF5;
    --auth-input-border: #E8DACB;
    --auth-input-focus-border: #A3C7AB;
    --auth-input-focus-shadow: rgba(163, 199, 171, 0.25);

    /* Interactive */
    --auth-btn: #1A1816;
    --auth-btn-hover: #0A0A09;
    --auth-btn-text: #FAFAF8;
    --auth-link: #5E8A65;
    --auth-link-hover: #3D6B44;

    /* Feedback */
    --auth-danger: #D94F4F;
    --auth-success: #4CAF6E;
    --auth-info-bg: #FFF8F0;
    --auth-info-border: #F2CAAF;

    /* Elevation */
    --shadow-card: 0 2px 24px rgba(26, 24, 22, 0.05);
    --shadow-input: 0 1px 2px rgba(26, 24, 22, 0.03);
    --shadow-btn: 0 2px 6px rgba(26, 24, 22, 0.1);
    --shadow-btn-hover: 0 4px 14px rgba(26, 24, 22, 0.18);

    /* Radii */
    --radius-card: 24px;
    --radius-input: 10px;
    --radius-btn: 10px;
    --radius-pill: 50px;
    /* Typography */
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ============ Reset ============ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/* ============ Base ============ */
.auth-page {
    height: 100vh;
    max-height: 100vh;
    background: var(--auth-bg);
    font-family: var(--font-body);
    color: var(--auth-text);
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
    position: relative;
}


/* ============ Card Container ============ */
.auth-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100vh;
    animation: cardEnter 0.55s var(--ease-out) both;
}

.auth-card {
    display: flex;
    background: var(--auth-card);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    height: 100vh;
}


/* ============ Brand Panel (Left) ============ */
.auth-brand {
    flex: 0 0 65%;
    background: var(--auth-panel);
    padding: 36px 32px 32px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Decorative rotated squares (matches hero banner pattern) */
.auth-brand .hero-square {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transform: rotate(45deg);
    pointer-events: none;
}

.auth-brand .hero-square.sq-1 {
    top: 3%;
    right: 5%;
    width: 80px;
    height: 80px;
    border-radius: 16px;
    border-color: rgba(255, 255, 255, 0.09);
}

.auth-brand .hero-square.sq-2 {
    top: 30%;
    right: 8%;
    width: 45px;
    height: 45px;
    border-color: rgba(255, 255, 255, 0.07);
}

.auth-brand .hero-square.sq-3 {
    top: 18%;
    right: 2%;
    width: 55px;
    height: 55px;
    border-radius: 14px;
    border-color: rgba(255, 255, 255, 0.06);
}

/* Brand illustration */
.auth-brand-illustration {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 45%;
    max-width: 320px;
    opacity: 0.12;
    pointer-events: none;
    z-index: 1;
    animation: fadeSlideUp 0.6s var(--ease-out) 0.5s both;
}

/* Brand content */
.auth-brand-content {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.auth-brand-logo {
    height: 36px;
    width: auto;
    margin-bottom: 28px;
    display: block;
    align-self: flex-start;
    animation: fadeSlideUp 0.45s var(--ease-out) 0.1s both;
}

.auth-brand-heading {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--auth-panel-text);
    margin: 0 0 10px;
    letter-spacing: -0.01em;
    animation: fadeSlideUp 0.45s var(--ease-out) 0.18s both;
}

.auth-brand-heading .auth-highlight {
    color: #4E31FF;
}

.auth-brand-sub {
    font-size: 13px;
    font-weight: 400;
    color: var(--auth-panel-muted);
    line-height: 1.6;
    max-width: 300px;
    margin: 0 0 24px;
    animation: fadeSlideUp 0.45s var(--ease-out) 0.26s both;
}

/* Feature pills */
.auth-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
    animation: fadeSlideUp 0.45s var(--ease-out) 0.34s both;
}

.auth-pill {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.auth-pill--peach {
    background: var(--auth-peach);
    color: #5C3A1E;
}

.auth-pill--lavender {
    background: var(--auth-lavender);
    color: #3D2A5C;
}

.auth-pill--sage {
    background: var(--auth-sage);
    color: #1E4A28;
}

.auth-pill--cream {
    background: var(--auth-cream);
    color: #5C4420;
}

.auth-pill i {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    font-size: 9px;
    flex-shrink: 0;
}

/* Feature card */
.auth-feature-card {
    margin-top: auto;
    background: rgba(250, 250, 248, 0.06);
    border: 1px solid rgba(250, 250, 248, 0.08);
    border-radius: 16px;
    padding: 18px 20px;
    position: relative;
    z-index: 2;
    max-width: 340px;
    animation: fadeSlideUp 0.45s var(--ease-out) 0.42s both;
}

.auth-feature-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--auth-panel-text);
    margin-bottom: 12px;
    letter-spacing: 0.01em;
}

.auth-feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12.5px;
    font-weight: 400;
    color: var(--auth-panel-muted);
    line-height: 1.45;
}

.auth-feature-list li i {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #FFFFFF;
    color: #1A1816;
    font-size: 8px;
    flex-shrink: 0;
}


/* ============ Form Panel (Right) ============ */
.auth-form-panel {
    flex: 1;
    padding: 40px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--auth-card);
    overflow: hidden;
}

.auth-form-inner {
    max-width: 370px;
    width: 100%;
    margin: 0 auto;
}

.auth-form-logo {
    height: 34px;
    width: auto;
    margin-bottom: 28px;
    display: block;
    animation: fadeSlideUp 0.45s var(--ease-out) 0.15s both;
}

.auth-form-heading {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 400;
    line-height: 1.25;
    color: var(--auth-text);
    margin: 0 0 6px;
    letter-spacing: -0.01em;
    animation: fadeSlideUp 0.45s var(--ease-out) 0.22s both;
}

.auth-form-sub {
    font-size: 14px;
    font-weight: 400;
    color: var(--auth-text-secondary);
    margin: 0 0 24px;
    line-height: 1.5;
    animation: fadeSlideUp 0.45s var(--ease-out) 0.28s both;
}


/* ============ Flash Messages ============ */
.auth-message {
    margin-bottom: 14px;
}

.auth-message:empty {
    display: none;
}

.auth-message p,
.auth-message div {
    padding: 10px 14px;
    border-radius: var(--radius-input);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    background: var(--auth-info-bg);
    border: 1px solid var(--auth-info-border);
    color: var(--auth-text);
}

.auth-message .error {
    background: #FFF0F0;
    border-color: #F0B8B8;
    color: var(--auth-danger);
}

.auth-message .success {
    background: #F0FFF4;
    border-color: #B8E0C0;
    color: var(--auth-success);
}


/* ============ Form Controls ============ */
.auth-form form {
    animation: fadeSlideUp 0.45s var(--ease-out) 0.34s both;
}

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

.auth-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

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

.auth-input {
    width: 100%;
    padding: 11px 14px;
    background: var(--auth-input-bg);
    border: 1.5px solid var(--auth-input-border);
    border-radius: var(--radius-input);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    color: var(--auth-text);
    box-shadow: var(--shadow-input);
    transition: var(--transition-base);
    outline: none;
}

.auth-input::placeholder {
    color: var(--auth-text-muted);
    font-weight: 400;
}

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

.auth-input:focus {
    border-color: var(--auth-input-focus-border);
    box-shadow: 0 0 0 3px var(--auth-input-focus-shadow), var(--shadow-input);
    background: #FFFFFF;
}

/* Password toggle */
.auth-input--password {
    padding-right: 44px;
}

.auth-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--auth-text-muted);
    font-size: 14px;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
}

.auth-password-toggle:hover {
    color: var(--auth-text-secondary);
}


/* ============ Remember / Forgot ============ */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.auth-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--auth-input-border);
    border-radius: 4px;
    background: var(--auth-input-bg);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: var(--transition-base);
    position: relative;
    flex-shrink: 0;
}

.auth-check input[type="checkbox"]:checked {
    background: var(--auth-btn);
    border-color: var(--auth-btn);
}

.auth-check input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.auth-check-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--auth-text-secondary);
    user-select: none;
}

.auth-forgot-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-link);
    text-decoration: none;
    transition: var(--transition-base);
}

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


/* ============ Button ============ */
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px 24px;
    background: var(--auth-btn);
    color: var(--auth-btn-text);
    border: none;
    border-radius: var(--radius-btn);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: var(--shadow-btn);
    transition: var(--transition-base);
}

.auth-btn:hover {
    background: var(--auth-btn-hover);
    box-shadow: var(--shadow-btn-hover);
    transform: translateY(-1px);
}

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


/* ============ Back Link ============ */
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--auth-link);
    text-decoration: none;
    transition: var(--transition-base);
}

.auth-back:hover {
    color: var(--auth-link-hover);
}

.auth-back i {
    font-size: 11px;
    transition: transform 0.2s ease;
}

.auth-back:hover i {
    transform: translateX(-3px);
}


/* ============ Footer ============ */
.auth-footer {
    padding-top: 16px;
    font-size: 11px;
    color: var(--auth-text-muted);
    letter-spacing: 0.01em;
    text-align: center;
    animation: fadeSlideUp 0.45s var(--ease-out) 0.45s both;
}

.auth-footer p {
    margin: 0;
}


/* ============ Entrance Animations ============ */
@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.995);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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



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

/* Tablet landscape */
@media (max-width: 1024px) {
    .auth-brand {
        flex: 0 0 60%;
        padding: 32px 28px 28px;
    }
    .auth-form-panel {
        padding: 36px 40px;
    }
    .auth-brand-heading {
        font-size: 28px;
    }
    .auth-brand-sub {
        font-size: 12px;
        margin-bottom: 18px;
    }
    .auth-feature-card {
        padding: 14px 16px;
    }
    .auth-feature-list li {
        font-size: 12px;
    }
}

/* Tablet portrait — stack layout */
@media (max-width: 860px) {
    .auth-page {
        align-items: stretch;
    }
    .auth-wrapper {
        margin: 0;
        max-width: 100%;
        height: 100vh;
        max-height: none;
    }
    .auth-card {
        flex-direction: column;
        border-radius: 0;
        height: 100vh;
    }
    .auth-brand {
        flex: 0 0 auto;
        padding: 22px 24px 16px;
    }
    .auth-brand-logo {
        height: 26px;
        margin-bottom: 14px;
    }
    .auth-brand-heading {
        font-size: 22px;
        margin-bottom: 0;
    }
    .auth-brand-sub {
        display: none;
    }
    .auth-pills {
        display: none;
    }
    .auth-feature-card {
        display: none;
    }
    .auth-form-panel {
        flex: 1;
        padding: 24px 28px 16px;
        border-radius: var(--radius-card) var(--radius-card) 0 0;
        margin-top: -14px;
        position: relative;
        z-index: 2;
        justify-content: flex-start;
    }
    .auth-form-logo {
        margin-bottom: 16px;
    }
    .auth-form-heading {
        font-size: 24px;
    }
    .auth-form-sub {
        margin-bottom: 16px;
        font-size: 13px;
    }
    .auth-field {
        margin-bottom: 12px;
    }
    .auth-input {
        padding: 10px 13px;
        font-size: 14px;
    }
    .auth-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    .auth-footer {
        padding-top: 8px;
    }
    .auth-back {
        margin-top: 12px;
    }
    .auth-row {
        margin-bottom: 14px;
    }
}

/* Mobile */
@media (max-width: 580px) {
    .auth-brand {
        padding: 18px 22px 14px;
    }
    .auth-brand-heading {
        font-size: 20px;
    }
    .auth-brand-logo {
        height: 22px;
        margin-bottom: 10px;
    }
    .auth-form-panel {
        padding: 20px 24px 14px;
    }
    .auth-form-logo {
        height: 28px;
        margin-bottom: 14px;
    }
    .auth-form-heading {
        font-size: 22px;
    }
    .auth-label {
        font-size: 12px;
        margin-bottom: 5px;
    }
    .auth-row {
        margin-bottom: 14px;
    }
    .auth-input {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Small mobile */
@media (max-width: 380px) {
    .auth-brand {
        padding: 14px 18px 12px;
    }
    .auth-brand-heading {
        font-size: 18px;
    }
    .auth-form-panel {
        padding: 16px 20px 12px;
    }
    .auth-form-heading {
        font-size: 20px;
    }
    .auth-form-logo {
        height: 24px;
        margin-bottom: 12px;
    }
    .auth-input {
        padding: 9px 11px;
        font-size: 13px;
    }
    .auth-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}
