@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&amp;display=swap');

:root {
    --primary: #6c5ce7;
    --primary-dark: #5a4bd1;
    --primary-light: #a29bfe;
    --primary-glow: rgba(108, 92, 231, 0.4);
    --success: #00b894;
    --success-light: #55efc4;
    --danger: #e17055;
    --info: #74b9ff;
    --bg: #0a0e1a;
    --bg-card: #111827;
    --bg-card2: #1a2235;
    --border: #1e293b;
    --text: #e2e8f0;
    --text-sec: #94a3b8;
    --text-muted: #64748b;
    --gradient-1: linear-gradient(135deg, #6c5ce7, #a29bfe);
    --gradient-2: linear-gradient(135deg, #00b894, #55efc4);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 40px rgba(0,0,0,0.4);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --primary: #6c5ce7;
    --primary-dark: #5a4bd1;
    --primary-light: #a29bfe;
    --primary-glow: rgba(108, 92, 231, 0.25);
    --success: #00b894;
    --success-light: #55efc4;
    --danger: #d63031;
    --info: #0984e3;
    --bg: #f0f2f5;
    --bg-card: #ffffff;
    --bg-card2: #f8f9fc;
    --border: #e2e8f0;
    --text: #1a202c;
    --text-sec: #4a5568;
    --text-muted: #a0aec0;
    --gradient-1: linear-gradient(135deg, #6c5ce7, #a29bfe);
    --gradient-2: linear-gradient(135deg, #00b894, #55efc4);
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow: hidden;
    transition: background 0.4s ease, color 0.4s ease;
}

body *,
body *::before,
body *::after {
    transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}

/* ===== CONTAINER ===== */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

/* ===== ANIMATED BACKGROUND ===== */
.auth-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.auth-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(108,92,231,0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(0,184,148,0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 80%, rgba(116,185,255,0.06) 0%, transparent 60%);
    animation: bgShift 15s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(2deg); }
    100% { transform: scale(1) rotate(-2deg); }
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.18;
    animation: shapeFloat 20s ease-in-out infinite;
}

.shape-1 {
    width: 500px; height: 500px;
    background: var(--primary);
    top: -10%; left: -10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 400px; height: 400px;
    background: var(--success);
    bottom: -10%; right: -10%;
    animation-delay: -5s;
}

.shape-3 {
    width: 300px; height: 300px;
    background: var(--info);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

.shape-4 {
    width: 350px; height: 350px;
    background: #fd79a8;
    top: 60%; left: -5%;
    animation-delay: -15s;
}

/* ===== AUTH THEME TOGGLE ===== */
.auth-theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-sec);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.auth-theme-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: rotate(30deg) scale(1.1);
    box-shadow: 0 0 25px var(--primary-glow);
}

@keyframes shapeFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(60px, -60px) scale(1.15); }
    50% { transform: translate(-40px, 40px) scale(0.85); }
    75% { transform: translate(50px, 30px) scale(1.1); }
}

/* ===== PARTICLES ===== */
.particle {
    position: absolute;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes particleFloat {
    0% { opacity: 0; transform: translateY(0) scale(0) rotate(0deg); }
    20% { opacity: 0.7; transform: translateY(-20px) scale(1) rotate(180deg); }
    50% { opacity: 0.4; transform: translateY(-40px) scale(0.8) rotate(360deg); }
    80% { opacity: 0.7; transform: translateY(-60px) scale(1.1) rotate(540deg); }
    100% { opacity: 0; transform: translateY(-80px) scale(0) rotate(720deg); }
}

/* ===== AUTH CARD ===== */
.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(30, 41, 59, 0.5);
    border-radius: var(--radius);
    padding: 40px 36px;
    box-shadow: var(--shadow);
    animation: cardIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transition: var(--transition);
}

.auth-card:hover {
    border-color: rgba(108, 92, 231, 0.2);
    box-shadow: 0 8px 50px rgba(0,0,0,0.5), 0 0 40px rgba(108,92,231,0.05);
}

.register-card { max-width: 520px; }

@keyframes cardIn {
    0% { opacity: 0; transform: translateY(40px) scale(0.95); }
    60% { transform: translateY(-5px) scale(1.01); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== AUTH HEADER ===== */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-logo-img {
    width: 10rem;
    height: auto;
    max-width: 100%;
    display: block;
    margin: 0 auto;
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@media (max-width: 480px) {
    .auth-logo-img { width: 7rem; }
}

@keyframes rocketFloat {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    25% { transform: translateY(-5px) rotate(5deg); }
    75% { transform: translateY(-3px) rotate(-3deg); }
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.auth-header p {
    font-size: 14px;
    color: var(--text-sec);
    margin: 0;
    animation: fadeInUp 0.6s ease 0.3s both;
}

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

.back-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-sec);
    font-size: 20px;
    text-decoration: none;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-card2);
    border: 1px solid var(--border);
}

.back-btn:hover {
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-50%) translateX(-3px);
    box-shadow: 0 4px 15px rgba(108,92,231,0.2);
}

/* ===== INPUT GROUPS ===== */
.input-group {
    position: relative;
    margin-bottom: 18px;
    animation: fadeInUp 0.5s ease both;
}

.input-group:nth-child(1) { animation-delay: 0.1s; }
.input-group:nth-child(2) { animation-delay: 0.15s; }
.input-group:nth-child(3) { animation-delay: 0.2s; }
.input-group:nth-child(4) { animation-delay: 0.25s; }
.input-group:nth-child(5) { animation-delay: 0.3s; }
.input-group:nth-child(6) { animation-delay: 0.35s; }

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    z-index: 2;
    transition: var(--transition);
    pointer-events: none;
}

.input-group.focused .input-icon {
    color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.auth-input {
    width: 100%;
    padding: 14px 16px 14px 48px !important;
    background: rgba(26, 34, 53, 0.8) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 14px !important;
    font-family: 'Inter', sans-serif !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    z-index: 1;
}

.auth-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15), 0 4px 20px rgba(108,92,231,0.1) !important;
    outline: none;
    transform: translateY(-2px);
}

.auth-input::placeholder {
    color: var(--text-muted);
    font-size: 14px;
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text) !important;
    -webkit-box-shadow: 0 0 0px 1000px rgba(26, 34, 53, 0.8) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.input-focus-ring {
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--primary);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.input-group.focused .input-focus-ring {
    opacity: 1;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    z-index: 2;
    padding: 4px;
    transition: var(--transition);
}

.password-toggle:hover { color: var(--primary); transform: translateY(-50%) scale(1.15); }

/* ===== PASSWORD STRENGTH ===== */
.password-strength {
    display: none;
    margin: -10px 0 18px;
    animation: fadeInUp 0.3s ease;
}

.strength-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.strength-text {
    font-size: 12px;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

/* ===== OPTIONS ===== */
.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease 0.3s both;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-sec);
    cursor: pointer;
    position: relative;
    padding-left: 28px;
    user-select: none;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    height: 18px;
    width: 18px;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: var(--transition);
}

.custom-checkbox:hover .checkmark {
    border-color: var(--primary);
}

.custom-checkbox input:checked ~ .checkmark {
    background: var(--gradient-1);
    border-color: transparent;
    animation: checkPop 0.3s ease;
}

@keyframes checkPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.checkmark:after {
    content: '';
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark:after { display: block; }

.custom-checkbox a {
    color: var(--primary);
    text-decoration: none;
}

.custom-checkbox a:hover { text-decoration: underline; }

.terms { padding-left: 28px; }

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

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

/* ===== AUTH BUTTON ===== */
.auth-btn {
    width: 100%;
    padding: 14px 28px;
    background: var(--gradient-1);
    background-size: 200% 200%;
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    animation: fadeInUp 0.5s ease 0.35s both;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.auth-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: var(--transition);
}

.auth-btn:hover::before { opacity: 1; }

.auth-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(108, 92, 231, 0.4), 0 0 40px rgba(108,92,231,0.1);
}

.auth-btn:active {
    transform: translateY(-1px);
}

.auth-btn.loading {
    pointer-events: none;
    opacity: 0.85;
}

.btn-loader {
    display: none;
    position: absolute;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ===== SOCIAL LOGIN ===== */
.social-login {
    margin-top: 28px;
    animation: fadeInUp 0.5s ease 0.4s both;
}

.divider {
    text-align: center;
    position: relative;
    margin-bottom: 20px;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.divider span {
    background: rgba(17, 24, 39, 0.9);
    padding: 0 16px;
    font-size: 13px;
    color: var(--text-muted);
    position: relative;
}

.social-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.social-btn {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(26, 34, 53, 0.8);
    color: var(--text-sec);
    font-size: 22px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.social-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: var(--transition);
}

.social-btn:hover {
    transform: translateY(-4px) scale(1.05);
}

.social-btn:active { transform: translateY(-1px) scale(1); }

.social-btn.google:hover { color: #DB4437; border-color: #DB4437; box-shadow: 0 4px 20px rgba(219,68,55,0.2); }
.social-btn.github:hover { color: #fff; border-color: #fff; box-shadow: 0 4px 20px rgba(255,255,255,0.1); }
.social-btn.twitter:hover { color: #1DA1F2; border-color: #1DA1F2; box-shadow: 0 4px 20px rgba(29,161,242,0.2); }

/* ===== AUTH FOOTER ===== */
.auth-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 14px;
    color: var(--text-sec);
    animation: fadeInUp 0.5s ease 0.45s both;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.auth-footer a:hover { color: var(--primary-light); text-decoration: underline; }

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(120%) scale(0.8);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 360px;
    opacity: 0;
}

.toast.show {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-success i { color: var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-error i { color: var(--danger); }
.toast-info { border-left: 4px solid var(--info); }
.toast-info i { color: var(--info); }

/* ===== RESPONSIVE ===== */
@media (max-width: 576px) {
    .auth-card { padding: 28px 20px; }
    .auth-card.register-card { max-width: 100%; }
    .auth-header h1 { font-size: 20px; }
    .shape { filter: blur(60px); }
    .shape-1 { width: 300px; height: 300px; }
    .shape-2 { width: 250px; height: 250px; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
