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

:root {
    --bg-color: #0b0f19;
    --card-bg: rgba(17, 24, 39, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.5);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --primary-glow: rgba(99, 102, 241, 0.3);
    --success-color: #10b981;
    --error-color: #ef4444;
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Background animated decorative circles for premium glow */
body::before, body::after {
    content: '';
    position: absolute;
    width: 35rem;
    height: 35rem;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.15;
    animation: floatGlow 15s infinite alternate ease-in-out;
}

body::before {
    background: #6366f1;
    top: -10%;
    left: -10%;
}

body::after {
    background: #a855f7;
    bottom: -10%;
    right: -10%;
    animation-delay: -7.5s;
}

@keyframes floatGlow {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* Auth Layout Container */
.auth-container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    perspective: 1000px;
}

/* Glassmorphism Card styling */
.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: cardEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--primary-gradient);
    margin-bottom: 20px;
    box-shadow: 0 8px 20px var(--primary-glow);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 24px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
    background: linear-gradient(to right, #ffffff, #d1d5db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Alert Boxes (Success & Error Messages) */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: alertSlideIn 0.3s ease-out forwards;
    border: 1px solid transparent;
}

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

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: #a7f3d0;
}

.alert-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-primary);
    font-family: var(--font-body);
    transition: all 0.25s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--border-focus);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-input::placeholder {
    color: rgba(156, 163, 175, 0.5);
}

/* Password Toggle Icon */
.password-toggle {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    padding: 0;
}

.password-toggle:hover {
    color: var(--text-primary);
}

/* Live validation indicator */
.input-feedback {
    font-size: 11px;
    margin-top: 6px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: all 0.2s ease;
}

.input-feedback.visible {
    opacity: 1;
    height: auto;
    margin-top: 6px;
}

.input-feedback.invalid {
    color: #fca5a5;
}

.input-feedback.valid {
    color: #a7f3d0;
}

/* Button & Action Styles */
.btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 15px;
    color: #ffffff;
    cursor: pointer;
    background: var(--primary-gradient);
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: 0.5s;
}

.btn:hover::after {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loader Animation inside Button */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

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

.btn.loading .spinner {
    display: inline-block;
}
.btn.loading .btn-text {
    opacity: 0.8;
}

/* Footer / Switch Screen Links */
.auth-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-link {
    color: #818cf8;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
    margin-left: 4px;
}

.auth-link:hover {
    color: #a5b4fc;
    text-decoration: underline;
}

/* --- Premium Protected Dashboard Layout --- */
.dashboard-container {
    width: 100%;
    max-width: 1000px;
    padding: 24px;
}

.dashboard-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    animation: cardEnter 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 8px 16px var(--primary-glow);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.welcome-info h1 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
}

.welcome-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: none;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

/* Dashboard Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(99, 102, 241, 0.2);
}

.stat-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
}

.stat-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.info-section {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px;
}

.info-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-list {
    list-style: none;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 14px;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
}

.info-val {
    color: var(--text-primary);
    font-weight: 500;
}

/* responsive changes */
@media (max-width: 640px) {
    .auth-card {
        padding: 32px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .btn-logout-wrapper {
        width: 100%;
    }
    
    .btn-logout-wrapper .btn {
        width: 100%;
    }
}
