/* Загальні стилі */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #bb86fc;
    --primary-dark: #9965f4;
    --secondary: #03dac6;
    --background: #050505;
    --surface: #121212;
    --surface-light: rgba(255, 255, 255, 0.03);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --border: rgba(255, 255, 255, 0.08);
    --gradient-1: linear-gradient(135deg, #bb86fc 0%, #6c63ff 100%);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 15px 50px rgba(187, 134, 252, 0.25);
    --glass-blur: blur(16px);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Auth Main */
.auth-main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4.75rem 1.25rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.auth-main::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(187, 134, 252, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}

.auth-container {
    width: 100%;
    max-width: 430px;
    z-index: 1;
}

.auth-card {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%),
        var(--surface-light);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    padding: 1.9rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    animation: fadeInUp 0.6s ease;
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.auth-header {
    text-align: center;
    margin-bottom: 1.15rem;
}

.auth-icon {
    font-size: 3.15rem;
    margin-bottom: 0.5rem;
    animation: bounce 2s ease-in-out infinite;
}

.auth-header h2 {
    font-size: 1.78rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-alt {
    display: grid;
    gap: 0;
    margin-bottom: 0.95rem;
}

.btn-provider {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    padding: 0.9rem 1.05rem;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 0.96rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.btn-provider:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    background: rgba(255, 255, 255, 0.07);
}

.btn-provider:disabled,
.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-flux {
    background: linear-gradient(135deg, rgba(98, 0, 234, 0.22) 0%, rgba(3, 218, 198, 0.15) 100%);
}

.flux-badge {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffffff 0%, #c6f7ff 100%);
    color: #130b25;
    font-weight: 800;
    flex-shrink: 0;
}

.auth-divider {
    position: relative;
    text-align: center;
    margin-bottom: 0.95rem;
}

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

.auth-divider span {
    position: relative;
    display: inline-block;
    padding: 0 0.85rem;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 0.92rem 0.98rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border);
    border-radius: 13px;
    color: var(--text-primary);
    font-size: 0.97rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 3.1rem;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.password-toggle:hover {
    opacity: 1;
}

.btn-submit {
    width: 100%;
    min-height: 50px;
    padding: 0.95rem 1.25rem;
    font-size: 1rem;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 13px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 0.1rem;
    box-shadow: 0 8px 25px rgba(187, 134, 252, 0.4);
    transition: all 0.3s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(187, 134, 252, 0.6);
}

.auth-footer {
    text-align: center;
    margin-top: 0.15rem;
    padding-top: 0.95rem;
    border-top: 1px solid var(--border);
}

.auth-footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Message Styles */
.error-message,
.success-message {
    display: none;
    padding: 0.9rem 0.95rem;
    border-radius: 12px;
    margin-bottom: 0.15rem;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.error-message.is-visible,
.success-message.is-visible {
    display: block;
}

.error-message {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #ff6b6b;
}

.success-message {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #4caf50;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .auth-card {
        padding: 1.7rem;
    }
    
    .auth-header h2 {
        font-size: 1.6rem;
    }

    .btn-provider {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .auth-main {
        padding: 5rem 1rem 3rem;
    }
    
    .auth-card {
        padding: 1.3rem;
    }
    
    .auth-icon {
        font-size: 2.8rem;
    }
}
