/**
 * Modern Authentication Pages CSS
 * Responsive design for Login, Signup, and Forgot Password pages
 * Mobile-first approach with full device compatibility
 */

/* ============================================
   CRITICAL: Mobile-First Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body.auth-page {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow-x: hidden;
}

/* ============================================
   Animated Background
   ============================================ */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    top: 60%;
    right: 15%;
    animation-delay: 3s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 20%;
    animation-delay: 6s;
}

.shape-4 {
    width: 250px;
    height: 250px;
    top: 40%;
    right: 30%;
    animation-delay: 9s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(20px, -20px) rotate(90deg);
    }

    50% {
        transform: translate(-20px, 20px) rotate(180deg);
    }

    75% {
        transform: translate(20px, 20px) rotate(270deg);
    }
}

.sparkle {
    position: absolute;
    font-size: 24px;
    animation: sparkle 3s infinite;
}

.sparkle-1 {
    top: 15%;
    left: 25%;
    animation-delay: 0s;
}

.sparkle-2 {
    top: 70%;
    right: 20%;
    animation-delay: 1s;
}

.sparkle-3 {
    bottom: 25%;
    left: 15%;
    animation-delay: 2s;
}

.sparkle-4 {
    top: 45%;
    right: 35%;
    animation-delay: 1.5s;
}

@keyframes sparkle {

    0%,
    100% {
        opacity: 0;
        transform: scale(0.5);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    animation: bubble 15s infinite;
}

.bubble-1 {
    width: 60px;
    height: 60px;
    bottom: -60px;
    left: 10%;
    animation-delay: 0s;
}

.bubble-2 {
    width: 40px;
    height: 40px;
    bottom: -40px;
    left: 30%;
    animation-delay: 2s;
}

.bubble-3 {
    width: 80px;
    height: 80px;
    bottom: -80px;
    left: 50%;
    animation-delay: 4s;
}

.bubble-4 {
    width: 50px;
    height: 50px;
    bottom: -50px;
    left: 70%;
    animation-delay: 6s;
}

.bubble-5 {
    width: 70px;
    height: 70px;
    bottom: -70px;
    left: 90%;
    animation-delay: 8s;
}

@keyframes bubble {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-100vh);
        opacity: 0;
    }
}

/* ============================================
   Back to Home Button
   ============================================ */
.btn-back-home {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-back-home:hover {
    background: #fff;
    color: #764ba2;
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-back-home i {
    font-size: 16px;
}

/* Mobile: Smaller back button */
@media (max-width: 576px) {
    .btn-back-home {
        top: 15px;
        left: 15px;
        padding: 10px 16px;
        font-size: 14px;
    }

    .btn-back-home span {
        display: none;
    }

    .btn-back-home i {
        font-size: 18px;
        margin: 0;
    }
}

/* ============================================
   Auth Card - Mobile First
   ============================================ */
.auth-card {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    max-width: 450px;
    width: 100%;
    margin: 0 auto;
}

/* Tablet and up */
@media (min-width: 768px) {
    .auth-card {
        padding: 50px 40px;
    }
}

/* Desktop */
@media (min-width: 992px) {
    .auth-card {
        padding: 60px 50px;
    }
}

/* ============================================
   Decorative Icons
   ============================================ */
.icon-decoration {
    position: absolute;
    font-size: 48px;
    opacity: 0.1;
    animation: float 6s infinite ease-in-out;
}

.icon-decoration-1 {
    top: 20px;
    right: 20px;
    animation-delay: 0s;
}

.icon-decoration-2 {
    bottom: 20px;
    left: 20px;
    animation-delay: 3s;
}

/* ============================================
   Logo and Title
   ============================================ */
.auth-logo {
    max-width: 120px;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.1));
}

.auth-card h3 {
    color: #2d3748;
    font-weight: 700;
    font-size: 28px;
    margin-bottom: 8px;
}

.auth-card p {
    color: #718096;
    font-size: 15px;
}

/* Mobile adjustments */
@media (max-width: 576px) {
    .auth-logo {
        max-width: 100px;
    }

    .auth-card h3 {
        font-size: 24px;
    }

    .auth-card p {
        font-size: 14px;
    }
}

/* ============================================
   Form Styles - Material Design Inspired
   ============================================ */
.form-outline {
    position: relative;
    margin-bottom: 24px;
}

.form-control {
    width: 100%;
    padding: 16px 12px 8px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    transition: all 0.3s ease;
    outline: none;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 16px;
    pointer-events: none;
    transition: all 0.3s ease;
    background: #fff;
    padding: 0 4px;
}

.form-control:focus+.form-label,
.form-control:not(:placeholder-shown)+.form-label {
    top: 0;
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
}

/* Mobile: Prevent zoom on input focus */
@media (max-width: 576px) {
    .form-control {
        font-size: 16px !important;
        /* Prevents iOS zoom */
    }
}

/* ============================================
   Checkbox and Links
   ============================================ */
.form-check-input {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-check-label {
    color: #4a5568;
    font-size: 14px;
    margin-left: 8px;
    cursor: pointer;
}

.auth-card a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-card a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* ============================================
   Buttons - Mobile Optimized
   ============================================ */
.btn {
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    text-decoration: none;
    /* Prevent tap highlight on mobile */
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-danger {
    background: #fff;
    color: #dc3545;
    border: 2px solid #dc3545;
}

.btn-outline-danger:hover {
    background: #dc3545;
    color: #fff;
}

.btn-block {
    width: 100%;
    margin-bottom: 16px;
}

/* Mobile: Larger touch targets */
@media (max-width: 576px) {
    .btn {
        padding: 16px 24px;
        font-size: 16px;
        min-height: 48px;
        /* Minimum touch target size */
    }
}

/* ============================================
   Divider
   ============================================ */
.divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.divider-text {
    position: relative;
    background: #fff;
    padding: 0 16px;
    color: #a0aec0;
    font-size: 14px;
    font-weight: 600;
}

/* ============================================
   Alerts - Mobile Optimized
   ============================================ */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-danger {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.alert-success {
    background: #f0fff4;
    color: #2f855a;
    border: 1px solid #9ae6b4;
}

.alert i {
    font-size: 18px;
}

.btn-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    color: inherit;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    opacity: 1;
}

/* ============================================
   Container Responsive Adjustments
   ============================================ */
.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }

    .auth-card {
        margin: 20px 10px;
        border-radius: 20px;
    }
}

/* ============================================
   Accessibility Improvements
   ============================================ */
.btn:focus,
.form-control:focus,
.form-check-input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid #000;
    }

    .form-control {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   Loading State
   ============================================ */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}