/* ===== CSS VARIABLES & DESIGN TOKENS ===== */
:root {
    /* Primary Blue Colors */
    --blue-900: #1e3a8a;
    --blue-800: #1e40af;
    --blue-700: #1d4ed8;
    --blue-600: #2563eb;
    --blue-500: #3b82f6;
    --blue-400: #60a5fa;
    --blue-300: #93c5fd;
    --blue-200: #bfdbfe;
    --blue-100: #dbeafe;

    /* Cyan Accent */
    --cyan-600: #0891b2;
    --cyan-500: #06b6d4;
    --cyan-400: #22d3ee;
    --cyan-300: #67e8f9;

    /* Success Green */
    --green-600: #059669;
    --green-500: #10b981;
    --green-400: #34d399;

    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--blue-600) 0%, var(--cyan-500) 100%);
    --gradient-background: linear-gradient(180deg, #0c1222 0%, #1a2332 50%, #1e3a5f 100%);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-blue: 0 10px 40px rgba(37, 99, 235, 0.3);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    opacity: 0;
    animation: fadeInPage 0.5s ease-in forwards;
}

@keyframes fadeInPage {
    to {
        opacity: 1;
    }
}

/* ===== ANIMATED BACKGROUND ===== */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-background);
    z-index: -2;
}

.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--blue-600) 0%, transparent 70%);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--cyan-500) 0%, transparent 70%);
    bottom: -10%;
    right: -10%;
    animation-delay: -7s;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--blue-500) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* ===== CONTAINER & LAYOUT ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-xl);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2xl);
    flex-wrap: wrap;
}

/* ===== LOGIN CARD ===== */
.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-xl), var(--shadow-blue);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== LOGO SECTION ===== */
.logo-container {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.logo {
    width: 70px;
    height: 70px;
    margin: 0 auto var(--spacing-md);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.app-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-xs);
    letter-spacing: -0.02em;
}

.app-subtitle {
    color: var(--gray-300);
    font-size: 0.95rem;
    font-weight: 400;
}

/* ===== FORM STYLES ===== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-200);
    margin-left: var(--spacing-xs);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: var(--spacing-md);
    font-size: 1.25rem;
    pointer-events: none;
    z-index: 1;
}

.form-input {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-md) 3rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--white);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-base);
    outline: none;
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.toggle-password {
    position: absolute;
    right: var(--spacing-md);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
    padding: var(--spacing-xs);
}

.toggle-password:hover {
    opacity: 1;
}

/* ===== FORM OPTIONS ===== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: calc(-1 * var(--spacing-xs));
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    margin-right: var(--spacing-sm);
    transition: all var(--transition-base);
    position: relative;
}

.checkbox-container input:checked~.checkmark {
    background: var(--gradient-primary);
    border-color: var(--blue-500);
}

.checkbox-container input:checked~.checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

.checkbox-label {
    font-size: 0.875rem;
    color: var(--gray-300);
}

.forgot-password {
    font-size: 0.875rem;
    color: var(--cyan-400);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.forgot-password:hover {
    color: var(--cyan-300);
}

/* ===== BUTTONS ===== */
.btn-primary {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.btn-primary::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 var(--transition-slow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), var(--shadow-blue);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary.loading .btn-text {
    opacity: 0;
}

.btn-primary.loading .btn-loader {
    display: block;
}

.btn-loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ===== SIGNUP SECTION ===== */
.signup-section {
    margin-top: var(--spacing-lg);
    text-align: center;
}

.signup-text {
    color: var(--gray-400);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
}

.telegram-link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--white);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition-base);
}

.telegram-link:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--cyan-400);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.telegram-icon {
    font-size: 1.25rem;
    animation: float-icon 2s infinite ease-in-out;
}

@keyframes float-icon {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

/* ===== FOOTER LINKS ===== */
.footer-links {
    margin-top: var(--spacing-xl);
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray-400);
}

.footer-link {
    color: var(--gray-400);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--cyan-400);
}

.separator {
    margin: 0 var(--spacing-sm);
}

/* ===== FEATURES PREVIEW ===== */
.features-preview {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    max-width: 400px;
    animation: slideUp 0.6s ease-out 0.2s both;
}

.feature-item {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-base);
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--blue-500);
    transform: translateX(10px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
}

.feature-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--white);
}

.feature-item p {
    font-size: 0.9rem;
    color: var(--gray-300);
    line-height: 1.5;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .features-preview {
        flex-direction: row;
        max-width: 100%;
        flex-wrap: wrap;
    }

    .feature-item {
        flex: 1;
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: var(--spacing-md);
    }

    .login-card {
        padding: var(--spacing-xl);
    }

    .app-title {
        font-size: 1.75rem;
    }

    .features-preview {
        flex-direction: column;
    }

    .feature-item:hover {
        transform: translateY(-5px);
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: var(--spacing-lg);
    }

    .app-title {
        font-size: 1.5rem;
    }

    .form-options {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: flex-start;
    }
}