/* ================================================
   AUTH PAGES — Sweep Design (Glassmorphism + Animated Gradients)
   Giriş və Qeydiyyat səhifələri üçün ümumi dizayn
   ================================================ */

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

body.auth-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0a0a1a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* ---- Canvas Particle Background ---- */
#particleCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ---- Ambient Gradient Blobs ---- */
.ambient-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
    animation: blobFloat 20s ease-in-out infinite;
}
.ambient-blob.blob1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #667eea 0%, transparent 70%);
    top: -10%; left: -10%;
    animation-delay: 0s;
}
.ambient-blob.blob2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #764ba2 0%, transparent 70%);
    bottom: -15%; right: -5%;
    animation-delay: -7s;
}
.ambient-blob.blob3 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(40px, 30px) scale(1.02); }
}

/* ---- Auth Container ---- */
.auth-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    padding: 20px;
    animation: containerFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* ---- Sweeping Gradient Border Wrapper ---- */
.auth-card-wrapper {
    position: relative;
    border-radius: 20px;
    padding: 2px;
    background: conic-gradient(
        from var(--angle, 0deg),
        #667eea, #764ba2, #06b6d4, #667eea
    );
    animation: borderSweep 4s linear infinite;
}

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes borderSweep {
    to { --angle: 360deg; }
}

/* Fallback for browsers that don't support @property */
@supports not (background: conic-gradient(from 0deg, red, blue)) {
    .auth-card-wrapper {
        animation: borderSweepFallback 4s linear infinite;
    }
    @keyframes borderSweepFallback {
        from { filter: hue-rotate(0deg); }
        to { filter: hue-rotate(360deg); }
    }
}

/* ---- Glassmorphism Card ---- */
.auth-card {
    background: rgba(15, 15, 35, 0.85);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-radius: 18px;
    padding: 40px 36px 36px;
    position: relative;
    overflow: hidden;
}

/* Inner glow */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}

/* ---- Logo / Brand ---- */
.auth-brand {
    text-align: center;
    margin-bottom: 32px;
    animation: staggerFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.auth-brand .logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px; height: 64px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 18px;
    margin-bottom: 16px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.35);
    animation: logoBounce 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.auth-brand .logo-icon::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255,255,255,0.12) 50%,
        transparent 60%
    );
    animation: logoShine 3s ease-in-out infinite;
}

.auth-brand .logo-icon svg {
    width: 32px; height: 32px;
    fill: #fff;
    position: relative;
    z-index: 1;
}

@keyframes logoBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes logoShine {
    0% { transform: translateX(-100%) rotate(45deg); }
    50%, 100% { transform: translateX(100%) rotate(45deg); }
}

.auth-brand h1 {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

.auth-brand .subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.5);
    margin-top: 4px;
}

/* ---- Form Styles ---- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ---- Floating Label Group ---- */
.input-group {
    position: relative;
    margin-bottom: 20px;
    animation: staggerFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.input-group:nth-child(1) { animation-delay: 0.25s; }
.input-group:nth-child(2) { animation-delay: 0.35s; }
.input-group:nth-child(3) { animation-delay: 0.45s; }
.input-group:nth-child(4) { animation-delay: 0.55s; }
.input-group:nth-child(5) { animation-delay: 0.65s; }
.input-group:nth-child(6) { animation-delay: 0.75s; }

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

.input-group label {
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    color: rgba(255,255,255,0.4);
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

/* Select float — always on top */
.input-group.select-group label {
    top: 14px;
    transform: none;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

.input-group textarea ~ label {
    top: 14px;
    transform: none;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    font-size: 15px;
    color: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-family: inherit;
}

.input-group select,
.input-group textarea {
    padding-top: 16px;
}

.input-group select option {
    background: #1a1a3e;
    color: #fff;
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: rgba(255,255,255,0.25);
}

/* Float up when focused or filled */
.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    top: -8px;
    transform: none;
    font-size: 11px;
    color: #667eea;
    background: #0f0f23;
    padding: 0 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Focus glow */
.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.08);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15), 0 0 20px rgba(102, 126, 234, 0.1);
}

/* Select & textarea float label always up */
.input-group.select-group input:focus + label,
.input-group.select-group input + label,
.input-group textarea:focus + label,
.input-group textarea + label {
    top: -8px;
    transform: none;
    font-size: 11px;
    color: #667eea;
    background: #0f0f23;
    padding: 0 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Small hint */
.input-hint {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    margin-top: 6px;
    padding-left: 2px;
}

/* ---- Submit Button ---- */
.auth-submit {
    position: relative;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 8px;
    animation: staggerFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
    letter-spacing: 0.3px;
}

.auth-submit::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.45);
}

.auth-submit:hover::before {
    left: 100%;
}

.auth-submit:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

/* ---- Error Message ---- */
.auth-error {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 20px;
    animation: errorShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    backdrop-filter: blur(8px);
    line-height: 1.5;
}

@keyframes errorShake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-3px); }
    40%, 60% { transform: translateX(3px); }
}

/* ---- Footer Links ---- */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: rgba(255,255,255,0.45);
    animation: staggerFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

.auth-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
    position: relative;
}

.auth-footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #667eea;
    transition: width 0.3s ease;
    border-radius: 1px;
}

.auth-footer a:hover {
    color: #8b9cf7;
}

.auth-footer a:hover::after {
    width: 100%;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .auth-container { padding: 16px; }
    .auth-card { padding: 32px 24px 28px; }
    .auth-brand h1 { font-size: 22px; }
    .auth-brand .logo-icon { width: 56px; height: 56px; border-radius: 16px; }
    .auth-brand .logo-icon svg { width: 28px; height: 28px; }
    .auth-brand { margin-bottom: 24px; }
    .ambient-blob.blob1 { width: 300px; height: 300px; }
    .ambient-blob.blob2 { width: 250px; height: 250px; }
    .ambient-blob.blob3 { width: 200px; height: 200px; }
}

@media (max-width: 360px) {
    .auth-card { padding: 28px 18px 24px; }
    .input-group input,
    .input-group select,
    .input-group textarea { padding: 14px; font-size: 14px; }
}

/* ---- Scrollbar (if card overflows on small screens) ---- */
.auth-card::-webkit-scrollbar { width: 4px; }
.auth-card::-webkit-scrollbar-track { background: transparent; }
.auth-card::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* ---- Loading State ---- */
.auth-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

.auth-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    top: 50%; left: 50%;
    margin: -10px 0 0 -10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Password toggle ---- */
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    z-index: 2;
    transition: color 0.2s;
    line-height: 1;
}

.password-toggle:hover {
    color: rgba(255,255,255,0.7);
}

.input-group input[type="password"],
.input-group input[type="text"].pw-field {
    padding-right: 44px;
}
