/* ═══════════════════════════════════════════════════════════
   AUTH PAGE STYLES
   Imports shared design variables from frontend variables.css
═══════════════════════════════════════════════════════════ */

/* Shared variables and local fonts (same as frontend) */
@import '../../frontend/css/variables.css';
@import '../../frontend/css/fonts.css';

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary) !important;
    background: linear-gradient(135deg, var(--dark) 0%, #1a1a2e 50%, var(--dark) 100%) !important;
    color: var(--text-light) !important;
    overflow-x: hidden;
    line-height: 1.55;
    position: relative;
    min-height: 100vh !important;
}

/* ─── Background Effects ─────────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(108, 99, 255, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(108, 99, 255, .06) 1px, transparent 1px);
    background-size: 52px 52px;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    width: 550px;
    height: 550px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(108, 99, 255, .15) 0%, transparent 65%);
    top: -150px;
    right: -80px;
    pointer-events: none;
    z-index: 0;
}

/* ─── Login Container ────────────────────────────────────── */
.auth-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    padding: 20px !important;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: rgba(13, 13, 22, .8) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light) !important;
    border-radius: var(--radius-xl) !important;
    padding: var(--spacing-2xl) var(--spacing-xl) !important;
    width: 100% !important;
    max-width: 450px !important;
    box-shadow: var(--shadow-lg) !important;
    animation: slideUp 0.6s ease-out;
}

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

/* ─── Logo Section ───────────────────────────────────────── */
.auth-logo-wrapper {
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
}

.auth-logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 75px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .95) 0%, rgba(245, 245, 251, .85) 100%);
    border-radius: var(--radius-lg);
    margin: 0 auto var(--spacing-lg);
    padding: var(--spacing-sm);
    box-shadow: 0 8px 32px rgba(108, 99, 255, .2);
}

.app_logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    width: auto;
    height: auto;
}

.auth-logo-text {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Form Styles ────────────────────────────────────────── */
.auth-form-group {
    margin-bottom: var(--spacing-lg);
    animation: fadeIn 0.6s ease-out;
    animation-fill-mode: both;
}

.auth-form-group:nth-child(1) {
    animation-delay: 0.1s;
}

.auth-form-group:nth-child(2) {
    animation-delay: 0.15s;
}

.auth-form-group:nth-child(3) {
    animation-delay: 0.2s;
}

.auth-form-group:nth-child(4) {
    animation-delay: 0.25s;
}

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

.auth-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(220, 220, 245, .9);
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-input {
    width: 100% !important;
    padding: var(--spacing-sm) var(--spacing-md) !important;
    background: rgba(255, 255, 255, .08) !important;
    border: 1.5px solid rgba(255, 255, 255, .16) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-light) !important;
    font-size: 14px !important;
    font-family: var(--font-primary) !important;
    outline: none !important;
    transition: var(--transition-base);
}

.auth-input::placeholder {
    color: rgba(255, 255, 255, .4);
}

.auth-input:focus {
    background: rgba(255, 255, 255, .12) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, .2) !important;
}

.auth-input.is-invalid {
    border-color: var(--danger) !important;
    background: rgba(248, 113, 113, .08) !important;
}

.auth-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(248, 113, 113, .15) !important;
}

.auth-error {
    display: block;
    color: #fca5a5;
    font-size: 12px;
    margin-top: 6px;
    font-weight: 500;
}

/* ─── Checkbox ───────────────────────────────────────────── */
.auth-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
    animation: fadeIn 0.6s ease-out 0.3s both;
}

.auth-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
    border: 1.5px solid rgba(255, 255, 255, .3);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .06);
}

.auth-checkbox:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.auth-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, .2);
}

.auth-checkbox-label {
    color: rgba(255, 255, 255, .75);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

/* ─── Button Section ─────────────────────────────────────── */
.auth-button-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    animation: fadeIn 0.6s ease-out 0.35s both;
}

.auth-forgot-link {
    color: rgba(255, 255, 255, .65);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition-fast);
    white-space: nowrap;
}

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

.auth-submit-btn {
    background: linear-gradient(135deg, var(--accent) 0%, #8b84ff 100%) !important;
    border: none !important;
    color: #fff !important;
    padding: var(--spacing-sm) var(--spacing-xl) !important;
    border-radius: var(--radius-md) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: var(--font-primary) !important;
    cursor: pointer !important;
    transition: var(--transition-base);
    box-shadow: var(--shadow-accent) !important;
    white-space: nowrap !important;
}

.auth-submit-btn:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, #7c72ff 100%) !important;
    box-shadow: 0 8px 25px rgba(108, 99, 255, .45) !important;
    transform: translateY(-2px) !important;
}

.auth-submit-btn:active {
    transform: translateY(0) !important;
}

/* ─── Divider ────────────────────────────────────────────── */
.auth-divider {
    width: 100%;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, .08);
    margin: 32px 0;
    animation: fadeIn 0.6s ease-out 0.4s both;
}

/* ─── Sign up Section ────────────────────────────────────── */
.auth-signup-section {
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, .7);
    animation: fadeIn 0.6s ease-out 0.45s both;
}

.auth-signup-section a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.auth-signup-section a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.float-end {
    float:right;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
═══════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
    .auth-card {
        padding: 40px 24px !important;
        border-radius: var(--radius-lg) !important;
    }

    .auth-logo-container {
        width: 85px;
        height: 85px;
        margin: 0 auto var(--spacing-md);
    }

    .auth-logo-text {
        font-size: 22px;
    }

    .auth-button-row {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .auth-forgot-link {
        order: 2;
        text-align: center;
        width: 100%;
        white-space: normal;
    }

    .auth-submit-btn {
        order: 1;
        width: 100%;
    }

    .auth-form-group {
        margin-bottom: var(--spacing-md);
    }

    .auth-label {
        font-size: 12px;
    }

    .auth-input {
        padding: 12px 14px !important;
        font-size: 14px !important;
    }
}

@media (max-width: 380px) {
    .auth-card {
        padding: 32px 20px !important;
    }

    .auth-logo-container {
        width: 75px;
        height: 75px;
        margin: 0 auto var(--spacing-sm);
    }

    .auth-logo-text {
        font-size: 20px;
    }

    .auth-submit-btn {
        padding: 12px 24px !important;
        font-size: 13.5px !important;
    }

    .auth-button-row {
        margin-bottom: 24px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        color-scheme: dark;
    }

    .auth-input {
        color: #fff !important;
    }
}

/* Social login — icon row (matches login screenshot) */
.auth-social-section {
    margin-top: 8px;
}

.auth-social-divider {
    display: flex;
    align-items: center;
    margin: 28px 0 22px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1;
}

.auth-social-divider::before,
.auth-social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
}

.auth-social-divider span {
    padding: 0 14px;
    background: rgba(13, 13, 22, 0.95);
    white-space: nowrap;
}

.auth-social-buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-bottom: 4px;
}

.auth-social-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.02);
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}

.auth-social-icon-btn:hover {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

.auth-social-icon-btn:focus-visible {
    outline: 2px solid rgba(108, 99, 255, 0.65);
    outline-offset: 2px;
}

.auth-social-svg {
    width: 22px;
    height: 22px;
    display: block;
}

.auth-social-svg-x {
    width: 20px;
    height: 20px;
    color: #e7e9ea;
}

.auth-social-demo-note {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    margin-top: 16px;
    line-height: 1.5;
}

.auth-social-demo-note code {
    font-size: 11px;
    color: #c4b5fd;
}
