/**
 * Coffee Shop V2 - Authentication Pages
 * Modern login & register design with beautiful animations
 */

/* ============================================
   AUTH BACKGROUND
   ============================================ */

.auth-page-bg {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f1f3d 0%, #1e3a5f 50%, #2d4f7a 100%);
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
}

.auth-page-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(212, 175, 55, 0.1) 0%, transparent 50%);
    animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

/* ============================================
   AUTH CONTAINER
   ============================================ */

.auth-container {
    position: relative;
    z-index: 2;
}

.auth-card {
    background: white;
    border-radius: 30px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: slideInUp 0.8s ease-out;
}

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

.auth-card-body {
    padding: 3rem;
}

/* ============================================
   AUTH HEADER
   ============================================ */

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

.auth-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #d4a574, #e6b885);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
    animation: iconPulse 2s ease-in-out infinite;
}

.auth-logo i {
    font-size: 2rem;
    color: white;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(212, 175, 55, 0.6);
    }
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-family: 'Playfair Display', serif;
    opacity: 1 !important;
}

.auth-subtitle {
    font-size: 1rem;
    color: #666;
    opacity: 1 !important;
}

/* ============================================
   FORM STYLING
   ============================================ */

.auth-form .form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 1 !important;
}

.auth-form .form-label i {
    color: #d4a574;
    font-size: 1rem;
}

.auth-form .form-label .text-danger {
    color: #DC3545;
    margin-left: auto;
}

.auth-form .form-control {
    border: 2px solid #E8E8E8;
    border-radius: 15px;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-form .form-control:focus {
    border-color: #d4a574;
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.15);
}

.auth-form .form-control::placeholder {
    color: #999;
}

/* Password Toggle */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #d4a574;
}

/* Form Check */
.auth-form .form-check {
    padding-left: 0;
}

.auth-form .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #E8E8E8;
    margin-right: 0.75rem;
}

.auth-form .form-check-input:checked {
    background-color: #d4a574;
    border-color: #d4a574;
}

.auth-form .form-check-label {
    color: #666;
    cursor: pointer;
    opacity: 1 !important;
}

.auth-form .form-check-label a {
    color: #d4a574;
    text-decoration: none;
    font-weight: 600;
}

.auth-form .form-check-label a:hover {
    text-decoration: underline;
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */

.btn-auth-submit {
    background: linear-gradient(135deg, #1e3a5f, #2d4f7a);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(27, 77, 62, 0.3);
}

.btn-auth-submit:hover {
    background: linear-gradient(135deg, #2d4f7a, #3a5f8f);
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(27, 77, 62, 0.4);
    color: white;
}

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

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

.btn-auth-submit.loading::after {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   ALERTS
   ============================================ */

.auth-alert {
    border-radius: 15px;
    padding: 1.25rem 1.5rem;
    border: none;
    margin-bottom: 2rem;
    animation: slideInDown 0.5s ease-out;
}

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

.auth-alert.alert-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(25, 135, 84, 0.1));
    border-left: 4px solid #28A745;
    color: #155724;
}

.auth-alert.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(200, 35, 51, 0.1));
    border-left: 4px solid #DC3545;
    color: #721C24;
}

.auth-alert ul {
    margin: 0;
    padding-left: 1.5rem;
}

.auth-alert li {
    opacity: 1 !important;
}

/* ============================================
   DIVIDER
   ============================================ */

.auth-divider {
    margin: 2rem 0;
    border-top: 2px solid #F0F0F0;
    position: relative;
}

.auth-divider::after {
    content: 'hoặc';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 0 1rem;
    color: #999;
    font-size: 0.9rem;
}

/* ============================================
   FOOTER LINKS
   ============================================ */

.auth-footer {
    text-align: center;
    margin-top: 2rem;
}

.auth-footer p {
    margin: 0;
    color: #666;
    font-size: 1rem;
    opacity: 1 !important;
}

.auth-footer a {
    color: #d4a574;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: #1e3a5f;
    text-decoration: underline;
}

/* ============================================
   BACK TO HOME
   ============================================ */

.back-to-home {
    margin-top: 2rem;
    text-align: center;
}

.back-to-home a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.back-to-home a:hover {
    color: white;
    transform: translateX(-5px);
}

/* ============================================
   SOCIAL LOGIN (Optional)
   ============================================ */

.social-login {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-social {
    flex: 1;
    padding: 0.875rem;
    border-radius: 12px;
    border: 2px solid #E8E8E8;
    background: white;
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-social:hover {
    border-color: #d4a574;
    background: rgba(212, 175, 55, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-social.google {
    color: #DB4437;
}

.btn-social.facebook {
    color: #1877F2;
}

/* ============================================
   PASSWORD STRENGTH METER
   ============================================ */

.password-strength {
    margin-top: 0.5rem;
    height: 4px;
    background: #E8E8E8;
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
}

.password-strength-bar.weak {
    width: 33%;
    background: #DC3545;
}

.password-strength-bar.medium {
    width: 66%;
    background: #FFC107;
}

.password-strength-bar.strong {
    width: 100%;
    background: #28A745;
}

/* ============================================
   FEATURES LIST (for Register)
   ============================================ */

.auth-features {
    background: linear-gradient(135deg, rgba(27, 77, 62, 0.05), rgba(45, 111, 95, 0.05));
    border-radius: 20px;
    padding: 2rem;
    margin-top: 2rem;
}

.auth-features h6 {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1.25rem;
    opacity: 1 !important;
}

.auth-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #666;
    margin-bottom: 0.75rem;
    opacity: 1 !important;
}

.auth-features li i {
    color: #28A745;
    font-size: 1.1rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .auth-page-bg {
        padding: 2rem 0;
    }

    .auth-card-body {
        padding: 2rem 1.5rem;
    }

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

    .auth-logo {
        width: 70px;
        height: 70px;
    }

    .auth-logo i {
        font-size: 1.75rem;
    }

    .btn-auth-submit {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .social-login {
        flex-direction: column;
    }
}

@media (max-width: 575px) {
    .auth-card-body {
        padding: 1.75rem 1.25rem;
    }

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

    .auth-form .form-control {
        padding: 0.75rem 1rem;
    }
}

/* ============================================
   INPUT VALIDATION STATES
   ============================================ */

.auth-form .form-control.is-invalid {
    border-color: #DC3545;
}

.auth-form .form-control.is-valid {
    border-color: #28A745;
}

.invalid-feedback,
.valid-feedback {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    opacity: 1 !important;
}

/* ============================================
   ANIMATIONS
   ============================================ */

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
