/* ===================================
   Auth System Styles
   =================================== */

:root {
    --primary: #6C63FF;
    --primary-dark: #5a52d5;
    --secondary: #FF6B6B;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --dark: #1a1a2e;
    --light: #f8f9fa;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    overflow-x: hidden;
}

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

/* Background Animation */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.bubble {
    position: absolute;
    bottom: -100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: rise 15s infinite ease-in;
}

.bubble:nth-child(1) {
    width: 80px;
    height: 80px;
    left: 10%;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    width: 40px;
    height: 40px;
    left: 20%;
    animation-delay: 2s;
    animation-duration: 12s;
}

.bubble:nth-child(3) {
    width: 60px;
    height: 60px;
    left: 60%;
    animation-delay: 4s;
}

.bubble:nth-child(4) {
    width: 100px;
    height: 100px;
    left: 80%;
    animation-delay: 1s;
    animation-duration: 18s;
}

.bubble:nth-child(5) {
    width: 50px;
    height: 50px;
    left: 40%;
    animation-delay: 3s;
}

@keyframes rise {
    0% {
        bottom: -100px;
        transform: translateX(0);
    }

    50% {
        transform: translateX(100px);
    }

    100% {
        bottom: 100%;
        transform: translateX(-200px);
    }
}

/* Auth Card */
.auth-card {
    background: white;
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

/* Logo */
.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.logo-web { color: var(--primary); }
.logo-en { color: var(--secondary); }

/* Form Containers */
.auth-form-container {
    animation: fadeIn 0.3s ease;
}

.auth-form-container.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Title & Subtitle */
.auth-title {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 10px;
    text-align: center;
}

.auth-subtitle {
    color: var(--gray);
    text-align: center;
    margin-bottom: 30px;
}

/* Form */
.auth-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
    font-size: 0.9rem;
}

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

.input-wrapper i {
    position: absolute;
    left: 15px;
    color: var(--gray);
    z-index: 1;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 15px 14px 45px;
    border: 2px solid var(--gray-light);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--light);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.1);
}

.input-wrapper input.error {
    border-color: var(--danger);
}

.toggle-password {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
    z-index: 1;
}

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

/* Password Strength */
.password-strength {
    margin-top: 8px;
    display: none;
}

.password-strength.active {
    display: block;
}

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

.strength-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
}

.strength-bar.weak::after {
    width: 33%;
    background: var(--danger);
}

.strength-bar.medium::after {
    width: 66%;
    background: var(--warning);
}

.strength-bar.strong::after {
    width: 100%;
    background: var(--success);
}

.strength-text {
    font-size: 0.8rem;
    color: var(--gray);
}

/* Error Messages */
.error-message {
    display: block;
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 5px;
    min-height: 18px;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--gray);
}

.checkbox-label input {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--primary-dark);
}

/* Buttons */
.btn-auth {
    width: 100%;
    padding: 15px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(108, 99, 255, 0.3);
}

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

.btn-auth:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: none;
}

.btn-auth.loading .btn-text {
    display: none;
}

.btn-auth.loading .btn-loader {
    display: inline;
}

/* Social Button */
.btn-social {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--gray-light);
    background: white;
    color: var(--dark);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-social:hover {
    background: var(--gray-light);
}

.btn-social.google {
    border-color: #ddd;
}

.btn-social.google i {
    color: #EA4335;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--gray);
    font-size: 0.9rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-light);
}

.auth-divider span {
    padding: 0 15px;
}

/* Switch Link */
.auth-switch {
    text-align: center;
    color: var(--gray);
    font-size: 0.9rem;
}

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

.auth-switch a:hover {
    color: var(--primary-dark);
}

/* Back Button */
.back-btn {
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.back-btn:hover {
    color: var(--primary);
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.toast.active {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid var(--success);
}

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

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.toast.error .toast-icon {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.toast.warning .toast-icon {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning);
}

.toast-content h4 {
    font-size: 1rem;
    margin-bottom: 3px;
    color: var(--dark);
}

.toast-content p {
    font-size: 0.85rem;
    color: var(--gray);
}

.toast-close {
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 5px;
}

.toast-close:hover {
    color: var(--dark);
}

/* Back to Home */
.back-home {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: white;
    color: var(--dark);
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 10;
}

.back-home:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Responsive */
@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
    }

    .back-home {
        bottom: 20px;
        left: 20px;
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Animations */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.shake {
    animation: shake 0.5s ease;
}
