/* core/static/core/css/account/auth.css */

/* ========================================
   AUTH PAGES – Body
   ======================================== */
.auth-body {
    margin: 0;
    min-height: 100vh;
    position: relative;
}


/* ========================================
   AUTH PAGES – Page Background
   ======================================== */
.auth-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: -20;
    background: linear-gradient(
        to bottom right,
        rgb(var(--color-primary-50)),
        rgb(var(--color-primary-100)),
        rgb(var(--color-accent-50))
    );
}

.auth-bg-orbs {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: -10;
}

.auth-bg-orb {
    position: absolute;
    border-radius: 9999px;
    filter: blur(48px);
    animation: float 6s ease-in-out infinite;
}

.auth-bg-orb--1 {
    top: 25%;
    left: 25%;
    width: 18rem;
    height: 18rem;
    background: linear-gradient(
        to right,
        rgb(var(--color-primary-300) / 0.3),
        rgb(var(--color-accent-400) / 0.3)
    );
}

.auth-bg-orb--2 {
    top: 75%;
    right: 25%;
    width: 24rem;
    height: 24rem;
    background: linear-gradient(
        to right,
        rgb(var(--color-primary-300) / 0.25),
        rgb(var(--color-primary-400) / 0.25)
    );
    animation-delay: -2s;
}

.auth-bg-orb--3 {
    bottom: 25%;
    left: 33%;
    width: 16rem;
    height: 16rem;
    background: linear-gradient(
        to right,
        rgb(var(--color-accent-300) / 0.2),
        rgb(var(--color-primary-400) / 0.2)
    );
    animation-delay: -4s;
}

.auth-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px);
    background-size: 50px 50px;
}


/* ========================================
   AUTH PAGES – Layout
   ======================================== */
.auth-page {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    
    font-family: var(--font-family);
}

.auth-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    padding: 1rem;
}

.auth-container--wide {
    max-width: 720px;
}


/* ========================================
   AUTH PAGES – Card
   ======================================== */
.auth-card-glow {
    display: none;
}

.auth-card {
    position: relative;
    z-index: 10;
    background: var(--auth-card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgb(var(--color-surface-200) / 0.5);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 2rem;
    transition: all 0.5s ease;
}

.auth-card:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

.auth-card-shimmer {
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    background-size: 200% 100%;
    animation: shimmer 60s infinite;
    opacity: 0;
    transition: opacity 0.7s ease;
    z-index: -10;
}

.auth-card:hover .auth-card-shimmer {
    opacity: 1;
}

@keyframes laser {
    0% { left: -150%; }
    100% { left: 150%; }
}


/* ========================================
   AUTH PAGES – Logo
   ======================================== */
.auth-logo-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}

.auth-logo-link {
    display: block;
    transition: opacity 0.2s ease;
}

.auth-logo-link:hover {
    opacity: 0.85;
}

.auth-logo-img {
    max-height: 5rem;
    max-width: 100%;
    width: auto;
    height: auto;
}

@media (min-width: 768px) {
    .auth-logo-img {
        max-height: 6rem;
    }
}

.auth-logo-divider {
    position: relative;
    z-index: 50;
    height: 1px;
    width: 2.5rem;
    margin: 0 auto 2rem;
    border-radius: 9999px;
    background: rgb(var(--color-surface-300));
    overflow: hidden;
}

.auth-logo-divider-laser {
    position: absolute;
    top: 0;
    height: 100%;
    width: 100%;
    animation: laser 5s linear infinite;
}

.auth-logo-divider-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        transparent,
        rgb(var(--color-primary-400) / 0.6),
        transparent
    );
    filter: blur(2px);
}

.auth-logo-divider-core {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        transparent,
        rgb(var(--color-primary-600)),
        transparent
    );
}


/* ========================================
   AUTH PAGES – Typography
   ======================================== */
.auth-header {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2.5rem;
}

.auth-heading {
    font-size: 2.25rem;
    font-weight: 700;
    color: rgb(var(--color-surface-800));
    text-align: center;
    margin: 0 0 1rem;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.auth-subtitle {
    color: rgb(var(--color-surface-600));
    text-align: center;
    line-height: 1.625;
    max-width: 24rem;
    font-size: 0.875rem;
    margin: 0;
}


/* ========================================
   AUTH PAGES – Form
   ======================================== */
.auth-form {
    position: relative;
    z-index: 10;
}

.auth-form > * + * {
    margin-top: 1.5rem;
}

/* ========================================
   AUTH PAGES – Field
   ======================================== */
.auth-field > * + * {
    margin-top: 0.75rem;
}

.auth-label {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(var(--color-surface-700));
    margin-bottom: 0.5rem;
}

.auth-label-indicator {
    display: none;
}

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

.auth-input,
input.auth-input,
select.auth-input,
textarea.auth-input {
    display: block;
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid rgb(var(--color-surface-300) / 0.6);
    background-color: rgba(255, 255, 255, 0.6);
    background-image: none;
    background-repeat: no-repeat;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: rgb(var(--color-surface-800));
    font-size: 1rem;
    font-family: var(--font-family);
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

select.auth-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
}

input[type="date"].auth-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
}

/* Hide native date picker indicator but keep it functional */
input[type="date"].auth-input::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 0;
    top: 0;
    width: 2.5rem;
    height: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
    opacity: 0;
}

select.auth-input option {
    background-color: rgb(255, 255, 255);
    color: rgb(var(--color-surface-800));
}

.auth-input::placeholder {
    color: rgb(var(--color-surface-500));
}

.auth-input:hover {
    border-color: rgb(var(--color-surface-400) / 0.7);
}

.auth-input:focus {
    border-color: rgb(var(--color-primary-400) / 0.7);
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: none;
}

.auth-input--error,
.auth-input--error:hover {
    border-color: rgb(239, 68, 68);
}

.auth-input-glow {
    position: absolute;
    inset: 0;
    border-radius: 0.75rem;
    background: linear-gradient(
        to right,
        rgb(var(--color-primary-500) / 0.1),
        rgb(var(--color-accent-500) / 0.1)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -10;
    filter: blur(4px);
    pointer-events: none;
}

.auth-input-wrapper:focus-within .auth-input-glow {
    opacity: 1;
}


/* ========================================
   AUTH PAGES – Checkbox
   ======================================== */
.auth-checkbox-row {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 10;
}

.auth-checkbox {
    height: 1rem;
    width: 1rem;
    border-radius: 0.25rem;
    border: 1px solid rgb(var(--color-surface-300));
    accent-color: rgb(var(--color-primary-600));
}

.auth-checkbox-label {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(var(--color-surface-700));
}


/* ========================================
   AUTH PAGES – Error messages
   ======================================== */
.auth-error {
    font-size: 0.875rem;
    color: rgb(220, 38, 38);
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}

.auth-error-dot {
    width: 0.375rem;
    height: 0.375rem;
    background: rgb(239, 68, 68);
    border-radius: 9999px;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

/* ========================================
   AUTH PAGES – Button (gradient)
   ======================================== */
.auth-btn {
    position: relative;
    width: 100%;
    display: block;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font-family);
    text-decoration: none;
    color: inherit;
}

.auth-btn-glow {
    position: absolute;
    inset: 0;
    background: rgb(var(--color-primary-600));
    border-radius: calc(infinity * 1px);
    filter: blur(4px);
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.auth-btn:hover .auth-btn-glow {
    opacity: 0.6;
}

.auth-btn-inner {
    position: relative;
    background: rgb(var(--color-primary-600));
    padding: 1rem 1.5rem;
    border-radius: calc(infinity * 1px);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.auth-btn:hover .auth-btn-inner {
    transform: scale(1.01);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    background: rgb(var(--color-primary-700));
}

.auth-btn:active .auth-btn-inner {
    transform: scale(0.98);
}

.auth-btn:focus-visible .auth-btn-inner {
    outline: 2px solid rgb(var(--color-primary-400) / 0.5);
    outline-offset: 2px;
}


/* ========================================
   AUTH PAGES – Links
   ======================================== */
.auth-link {
    color: rgb(var(--color-primary-600));
    font-weight: 500;
    transition: color 0.2s ease;
    text-decoration: none;
}

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


/* ========================================
   AUTH PAGES – Divider
   ======================================== */
.auth-divider {
    border: none;
    border-top: 1px solid rgb(var(--color-surface-200) / 0.5);
    margin: 1.5rem 0;
}


/* ========================================
   AUTH PAGES – Required asterisk
   ======================================== */
.auth-required {
    color: rgb(239, 68, 68);
    margin-left: 0.125rem;
}


/* ========================================
   AUTH PAGES – Actions area
   ======================================== */
.auth-actions {
    padding-top: 1rem;
    position: relative;
    z-index: 10;
}

.auth-section-divider {
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid rgb(var(--color-surface-200) / 0.5);
    position: relative;
    z-index: 10;
}

.auth-section-divider > * + * {
    margin-top: 1rem;
}

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

.auth-text-muted {
    font-size: 0.875rem;
    color: rgb(var(--color-surface-600));
}

.auth-mt-6 {
    margin-top: 1.5rem;
}

.auth-pt-2 {
    padding-top: 0.5rem;
}


/* ========================================
   AUTH PAGES – Phone field layout
   ======================================== */
.auth-phone-wrapper {
    display: flex;
    flex-direction: column;
    position: relative;
}

.auth-phone-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}


/* ========================================
   AUTH PAGES – Misc / Hidden
   ======================================== */
.auth-hidden {
    display: none;
}

.auth-page-container {
    width: 100%;
    max-width: 48rem;
}


/* ========================================
   AUTH PAGES – Dark Mode
   ======================================== */
@media (prefers-color-scheme: dark) {

    /* Background gradient */
    .auth-bg {
        background: rgb(var(--color-surface-800));
    }

    /* Background orbs - slightly more subtle on dark surface */
    .auth-bg-orb--1 {
        background: linear-gradient(
            to right,
            rgb(var(--color-primary-700) / 0.2),
            rgb(var(--color-accent-700) / 0.2)
        );
    }

    .auth-bg-orb--2 {
        background: linear-gradient(
            to right,
            rgb(var(--color-primary-700) / 0.08),
            rgb(var(--color-primary-700) / 0.08)
        );
    }

    .auth-bg-orb--3 {
        background: linear-gradient(
            to right,
            rgb(var(--color-accent-700) / 0.05),
            rgb(var(--color-primary-700) / 0.05)
        );
    }

    /* Background grid - make it more prominent on the darker background */
    .auth-bg-grid {
        background-image:
            linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
            linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    }

    /* Card */
    .auth-card {
        border-color: rgb(var(--color-surface-800) / 0.4);
    }

    .auth-card:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .auth-card-shimmer {
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    }

    /* Logo divider */
    .auth-logo-divider {
        background: rgb(var(--color-surface-800));
    }

    /* Typography */
    .auth-heading {
        color: rgb(var(--color-surface-200));
    }

    .auth-subtitle {
        color: rgb(var(--color-surface-400));
    }

    /* Labels */
    .auth-label {
        color: rgb(var(--color-surface-300));
    }

    /* Inputs */
    .auth-input,
    input.auth-input,
    select.auth-input,
    textarea.auth-input {
        background-color: rgba(255, 255, 255, 0.05);
        background-image: none;
        border-color: rgb(var(--color-surface-400) / 0.8);
        color: rgb(var(--color-surface-100));
        color-scheme: dark;
    }

    .auth-input::placeholder {
        color: rgb(var(--color-surface-300));
    }

    .auth-input:hover {
        border-color: rgb(var(--color-surface-300) / 0.8);
    }

    .auth-input:focus {
        border-color: rgb(var(--color-primary-400) / 0.9);
        background-color: rgba(255, 255, 255, 0.07);
    }

    select.auth-input {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    }

    input[type="date"].auth-input {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'%3E%3C/path%3E%3C/svg%3E");
    }

    select.auth-input option {
        background-color: rgb(var(--color-surface-900));
        color: rgb(var(--color-surface-100));
    }

    /* Checkbox */
    .auth-checkbox {
        border-color: rgb(var(--color-surface-500));
    }

    .auth-checkbox-label {
        color: rgb(var(--color-surface-300));
    }

    /* Error messages */
    .auth-error {
        color: rgb(248, 113, 113);
    }

    .auth-error-dot {
        background: rgb(248, 113, 113);
    }

    .auth-error-box {
        background: rgba(127, 29, 29, 0.3);
        border-color: rgba(153, 27, 27, 0.3);
    }

    .auth-error-box-icon {
        color: rgb(248, 113, 113);
    }

    .auth-error-box-text {
        color: rgb(254, 202, 202);
    }

    /* Buttons */
    .auth-btn-glow {
        background: rgb(var(--color-primary-500));
        opacity: 0.2;
    }

    .auth-btn-inner {
        background: rgb(var(--color-primary-500));
        color: white;
    }

    .auth-btn:hover .auth-btn-inner {
        background: rgb(var(--color-primary-400));
    }

    /* Links */
    .auth-link {
        color: rgb(var(--color-primary-400));
    }

    .auth-link:hover {
        color: rgb(var(--color-primary-300));
    }

    /* Dividers */
    .auth-divider {
        border-top-color: rgb(var(--color-surface-700) / 0.3);
    }

    .auth-section-divider {
        border-top-color: rgb(var(--color-surface-700) / 0.3);
    }

    /* Muted text */
    .auth-text-muted {
        color: rgb(var(--color-surface-400));
    }

    /* Required asterisk */
    .auth-required {
        color: rgb(248, 113, 113);
    }
}
