/* ============================================
   AUTHENTICATION STYLES - MIRACULOUS EDITION
   ============================================ */

:root {
    --primary-blue: #2563eb;
    --primary-blue-light: #3b82f6;
    --primary-blue-dark: #1e40af;
    --secondary-blue: #60a5fa;
    --accent-blue: #93c5fd;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-900: #111827;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --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);
}

/* ============================================
   ANIMATED BACKGROUND
   ============================================ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

/* Floating orbs background animation */
.auth-container::before,
.auth-container::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.auth-container::before {
    width: 500px;
    height: 500px;
    background: var(--secondary-blue);
    top: -250px;
    left: -250px;
    animation-delay: 0s;
}

.auth-container::after {
    width: 400px;
    height: 400px;
    background: var(--primary-blue-light);
    bottom: -200px;
    right: -200px;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(50px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-30px, 30px) scale(0.9);
    }
}

/* ============================================
   GLASS MORPHISM CARD
   ============================================ */
.auth-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.18);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: center;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Decorative corner accents */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, transparent 70%);
    border-radius: 24px 0 0 0;
    opacity: 0.1;
}

.auth-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, transparent 30%, var(--secondary-blue) 100%);
    border-radius: 0 0 24px 0;
    opacity: 0.1;
}

/* ============================================
   HEADER SECTION
   ============================================ */
.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 1;
}

.auth-header h2 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

.auth-header p {
    color: var(--gray-600);
    font-size: 1rem;
    animation: fadeIn 0.8s ease-out 0.4s both;
}

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

/* ============================================
   FORM STYLES
   ============================================ */
.auth-form {
    position: relative;
    z-index: 1;
}

.form-group {
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease-out both;
}

.form-group:nth-child(1) { animation-delay: 0.5s; }
.form-group:nth-child(2) { animation-delay: 0.6s; }
.form-group:nth-child(3) { animation-delay: 0.7s; }
.form-group:nth-child(4) { animation-delay: 0.8s; }
.form-group:nth-child(5) { animation-delay: 0.9s; }
.form-group:nth-child(6) { animation-delay: 1s; }

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

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

/* ============================================
   INPUT FIELDS WITH MAGIC
   ============================================ */
.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    background: var(--white);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: var(--gray-50);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.form-control:hover:not(:focus) {
    border-color: var(--gray-300);
}

/* Floating label effect */
.form-group {
    position: relative;
}

.form-control::placeholder {
    color: var(--gray-300);
    transition: all 0.3s ease;
}

.form-control:focus::placeholder {
    opacity: 0.5;
    transform: translateX(5px);
}

/* Input icons (if needed) */
.form-group.has-icon {
    position: relative;
}

.form-group.has-icon .form-control {
    padding-left: 3rem;
}

.form-group.has-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-300);
    transition: color 0.3s ease;
}

.form-group.has-icon .form-control:focus ~ i {
    color: var(--primary-blue);
}

/* ============================================
   FORM TEXT / HINTS
   ============================================ */
.form-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.825rem;
    color: var(--gray-600);
    opacity: 0;
    transform: translateY(-5px);
    animation: fadeIn 0.3s ease-out 0.2s forwards;
}

/* ============================================
   CHECKBOX STYLING
   ============================================ */
.form-group-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease-out 0.9s both;
}

.form-group-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    cursor: pointer;
    appearance: none;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group-checkbox input[type="checkbox"]:hover {
    border-color: var(--primary-blue);
}

.form-group-checkbox input[type="checkbox"]:checked {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
}

.form-group-checkbox input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: white;
    font-size: 14px;
    font-weight: bold;
    animation: checkPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes checkPop {
    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

.form-group-checkbox label {
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    color: var(--gray-700);
    margin: 0;
}

/* ============================================
   SELECT DROPDOWN STYLING
   ============================================ */
select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234b5563' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    appearance: none;
}

/* ============================================
   BUTTON MAGIC
   ============================================ */
.btn {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 15px 0 rgba(37, 99, 235, 0.3);
}

.btn-block {
    width: 100%;
    display: block;
    animation: fadeInUp 0.6s ease-out 1s both;
}

/* Ripple effect */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(37, 99, 235, 0.4);
}

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

/* Loading state */
.btn.loading {
    pointer-events: none;
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   FOOTER SECTION
   ============================================ */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
    animation: fadeIn 1s ease-out 1.2s both;
}

.auth-footer p {
    color: var(--gray-600);
    font-size: 0.95rem;
    margin: 0;
}

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

.auth-footer a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: var(--primary-blue);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.auth-footer a:hover::after {
    width: 100%;
}

/* ============================================
   PASSWORD STRENGTH INDICATOR
   ============================================ */
.password-strength {
    margin-top: 0.75rem;
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
}

.password-strength-bars {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.password-strength-bar {
    flex: 1;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.password-strength-bar.active {
    animation: barGrow 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes barGrow {
    0% {
        transform: scaleX(0);
    }
    100% {
        transform: scaleX(1);
    }
}

.password-strength-text {
    font-size: 0.875rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

/* ============================================
   VALIDATION FEEDBACK
   ============================================ */
.form-control.valid {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.form-control.invalid {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.05);
}

.password-match-feedback {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.password-match-feedback i {
    font-size: 1rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 640px) {
    .auth-container {
        padding: 1rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .auth-header h2 {
        font-size: 1.75rem;
    }

    .form-control {
        padding: 0.75rem;
    }

    .btn {
        padding: 0.75rem 1.25rem;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.form-control:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 2px solid var(--primary-blue-dark);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}