/* =====================================================
   CosmicTools — auth.css
   Styles for the login/signup page only.
   Loaded after main.css on index.php.
   ===================================================== */

/* ── YouTube Background Video ───────────────────────── */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.video-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(9, 9, 11, 0.82) 0%,
            rgba(9, 9, 11, 0.65) 40%,
            rgba(88, 28, 135, 0.25) 70%,
            rgba(9, 9, 11, 0.80) 100%);
    z-index: 1;
}

.video-background iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: none;
}

/* ── Ambient Glow Orbs ──────────────────────────────── */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 1;
    pointer-events: none;
    animation: orbFloat 12s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.18), transparent 70%);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.12), transparent 70%);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.10), transparent 70%);
    top: 50%;
    left: 60%;
    animation-delay: -8s;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -20px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 15px) scale(0.95);
    }
}

/* ── Floating Particles ─────────────────────────────── */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(167, 139, 250, 0.3);
    border-radius: 50%;
    animation: particleDrift linear infinite;
}

@keyframes particleDrift {
    0% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
        transform: translateY(90vh) translateX(10px) scale(1);
    }

    90% {
        opacity: 0.5;
    }

    100% {
        transform: translateY(-10vh) translateX(-20px) scale(0.3);
        opacity: 0;
    }
}

/* ── Page Wrapper ───────────────────────────────────── */
.page-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 20px;
    padding-top: max(24px, env(safe-area-inset-top, 24px));
    padding-bottom: max(24px, env(safe-area-inset-bottom, 24px));
    box-sizing: border-box;
}

/* ── Glass Auth Card ────────────────────────────────── */
.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(9, 9, 11, 0.55);
    backdrop-filter: blur(32px) saturate(1.4);
    -webkit-backdrop-filter: blur(32px) saturate(1.4);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03),
        var(--shadow-card);
    overflow: hidden;
    animation: cardEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform: translateY(20px);
    opacity: 0;
}

@keyframes cardEntrance {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.card-inner {
    padding: 40px 36px 36px;
}

/* ── Logo ───────────────────────────────────────────── */
.logo-wrapper {
    text-align: center;
    margin-bottom: 32px;
}

.logo-wrapper img {
    height: 38px;
    filter: brightness(1.1) drop-shadow(0 0 20px rgba(139, 92, 246, 0.2));
    transition: filter var(--transition-normal);
}

.logo-wrapper img:hover {
    filter: brightness(1.3) drop-shadow(0 0 30px rgba(139, 92, 246, 0.4));
}

/* ── Toggle Tabs ────────────────────────────────────── */
.auth-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 28px;
    position: relative;
}

.auth-toggle .slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-radius: 11px;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35);
}

.auth-toggle.signup .slider {
    transform: translateX(100%);
}

.toggle-btn {
    flex: 1;
    padding: 11px 0;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: color var(--transition-normal);
    user-select: none;
    border: none;
    background: none;
    letter-spacing: 0.3px;
    font-family: 'Inter', sans-serif;
}

.toggle-btn.active {
    color: #ffffff;
}

/* ── Form Container ─────────────────────────────────── */
.form-container {
    position: relative;
    overflow: hidden;
}

.auth-form {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-form.hidden {
    display: none;
}

.auth-form.fade-in {
    animation: fadeSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Form Heading ───────────────────────────────────── */
.form-heading {
    margin-bottom: 24px;
}

.form-heading h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.form-heading p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ── Flash / Inline Error ───────────────────────────── */
.auth-flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 18px;
    font-family: inherit;
}

.auth-flash.error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--color-error-text);
}

.auth-flash.success {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #86efac;
}

.auth-flash svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 1px;
}

/* ── Field Group ────────────────────────────────────── */
.field-group {
    margin-bottom: 18px;
}

.field-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: rgba(161, 161, 170, 0.9);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

/* ── Input Wrapper ──────────────────────────────────── */
.input-wrapper {
    position: relative;
}

.input-wrapper .input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: rgba(161, 161, 170, 0.5);
    transition: color var(--transition-normal);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 13px 14px 13px 42px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    color: var(--text-heading);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all var(--transition-normal);
}

.input-wrapper input::placeholder {
    color: rgba(113, 113, 122, 0.7);
}

.input-wrapper input:focus {
    border-color: var(--border-focus);
    background: rgba(139, 92, 246, 0.04);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1), 0 0 20px rgba(139, 92, 246, 0.05);
}

.input-wrapper input:focus~.input-icon {
    color: var(--color-accent);
}

/* ── Password Toggle ────────────────────────────────── */
.password-toggle {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(161, 161, 170, 0.5);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-normal);
}

.password-toggle:hover {
    color: var(--color-accent);
}

/* ── Extras Row (remember me + forgot) ─────────────── */
.extras-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.remember-me input[type="checkbox"]:checked {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.remember-me input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 4.5px;
    width: 5px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.remember-me span {
    font-size: 12px;
    color: var(--text-muted);
}

.forgot-link {
    font-size: 12px;
    color: var(--color-accent);
    font-weight: 500;
}

.forgot-link:hover {
    color: var(--color-accent-light);
}

/* ── Submit Button ──────────────────────────────────── */
.submit-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 50%, var(--color-primary-deep) 100%);
    color: #ffffff;
    box-shadow: var(--shadow-btn);
    transition: all var(--transition-normal);
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 30px rgba(124, 58, 237, 0.5), 0 0 60px rgba(124, 58, 237, 0.15);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.submit-btn:not(:disabled):hover::before {
    left: 100%;
}

/* ── Divider ────────────────────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    gap: 14px;
}

.divider span {
    font-size: 11px;
    color: var(--text-faint);
    white-space: nowrap;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 500;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
}

/* ── Social Buttons ─────────────────────────────────── */
.social-buttons {
    display: flex;
    gap: 10px;
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    color: rgba(228, 228, 231, 0.85);
    font-size: 12px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.social-btn:hover {
    background: var(--bg-hover);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.social-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ── Terms ──────────────────────────────────────────── */
.terms-text {
    text-align: center;
    font-size: 11px;
    color: var(--text-faint);
    margin-top: 24px;
    line-height: 1.6;
}

.terms-text a {
    color: rgba(167, 139, 250, 0.7);
}

.terms-text a:hover {
    color: var(--color-accent-light);
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 480px) {
    .card-inner {
        padding: 24px 20px;
    }

    .form-heading h1 {
        font-size: 19px;
    }

    .form-heading {
        margin-bottom: 18px;
    }

    .field-group {
        margin-bottom: 14px;
    }

    .social-buttons {
        flex-direction: column;
    }

    .social-btn {
        width: 100%;
    }
}

@media (max-width: 390px) {
    .card-inner {
        padding: 20px 16px;
    }

    .logo-wrapper {
        margin-bottom: 20px;
    }

    .logo-wrapper img {
        height: 30px;
    }

    .auth-toggle {
        margin-bottom: 20px;
    }

    .form-heading {
        margin-bottom: 16px;
    }

    .form-heading h1 {
        font-size: 17px;
    }

    .field-group {
        margin-bottom: 12px;
    }

    .input-wrapper input {
        padding: 11px 12px 11px 38px;
        font-size: 13px;
    }

    .submit-btn {
        padding: 12px;
        font-size: 13px;
    }

    .divider {
        margin: 16px 0;
    }

    .extras-row {
        margin-bottom: 16px;
    }

    .terms-text {
        margin-top: 16px;
    }
}

@media (max-height: 600px) {
    .page-wrapper {
        align-items: flex-start;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .logo-wrapper {
        margin-bottom: 16px;
    }

    .logo-wrapper img {
        height: 28px;
    }

    .auth-toggle {
        margin-bottom: 16px;
    }

    .form-heading {
        margin-bottom: 14px;
    }

    .field-group {
        margin-bottom: 10px;
    }

    .divider {
        margin: 12px 0;
    }
}