/* Clean Auth Pages Styles with Subtle Animations */

:root {
    --primary: #3f0b79;
    --primary-dark: #2d0855;
    --primary-light: #6d28d9;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --white: #ffffff;
}

/* Fix body and html for auth pages */
body:has(.auth-container),
html:has(.auth-container) {
    margin: 0 !important;
    padding: 0 !important;
    height: 100%;
    overflow-x: hidden;
}

body:has(.auth-container) {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Override main wrapper padding for auth pages */
body:has(.auth-container) main,
main:has(.auth-container) {
    padding: 0 !important;
    margin: 0 !important;
    min-height: 100vh;
    background: transparent;
}

/* Auth Container */
.auth-container {
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 2rem;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Subtle Animated Background */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    z-index: 0;
    overflow: hidden;
    opacity: 0.3;
    pointer-events: none;
}

.floating-shapes {
    position: relative;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    animation: float 30s infinite ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    top: -200px;
    left: -200px;
    animation-duration: 40s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    bottom: -150px;
    right: -150px;
    animation-duration: 35s;
    animation-delay: 5s;
}

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

/* Auth Wrapper */
.auth-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    animation: fadeInUp 0.5s ease-out;
}

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

/* Auth Card */
.auth-card {
    background: var(--white);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Logo Section */
.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.logo-img {
    max-width: 180px;
    max-height: 60px;
    height: auto;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
    display: block;
}

.logo-img:hover {
    transform: scale(1.05);
}

.logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.logo-fallback i {
    font-size: 2rem;
}

.logo-tagline {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-top: 0.25rem;
    opacity: 0.8;
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    color: var(--gray-500);
    font-size: 0.9375rem;
    margin: 0;
}

/* Auth Form */
.auth-form {
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-of-type {
    margin-bottom: 0;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1rem;
    transition: color 0.2s ease;
    z-index: 2;
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    font-size: 0.9375rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    color: var(--gray-900);
    transition: all 0.2s ease;
    outline: none;
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-input:hover {
    border-color: var(--gray-300);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(63, 11, 121, 0.1);
}

.form-input:focus ~ .input-icon {
    color: var(--primary);
}

.input-label {
    display: none;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s ease;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.password-toggle:focus {
    outline: none;
}

/* Error Message */
.error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--danger);
    font-size: 0.8125rem;
    margin-top: 0.5rem;
    animation: fadeIn 0.3s ease;
}

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

.error-message i {
    font-size: 0.75rem;
}

.form-input.is-invalid {
    border-color: var(--danger);
}

.form-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

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

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    margin-top: -0.5rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-input {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-label {
    color: var(--gray-600);
    font-size: 0.875rem;
    cursor: pointer;
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

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

/* Auth Button */
.auth-button {
    width: 100%;
    padding: 0.875rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--white);
    background: var(--primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
}

.auth-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(63, 11, 121, 0.3);
}

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

.auth-button.loading {
    pointer-events: none;
}

.auth-button.loading .button-text {
    opacity: 0;
}

.auth-button.loading .button-loader {
    opacity: 1;
}

.button-text {
    display: inline-block;
    transition: opacity 0.2s ease;
}

.button-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.button-loader i {
    font-size: 1.125rem;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

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

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

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

/* Override main wrapper padding for auth pages */
body:has(.auth-container) main,
main:has(.auth-container) {
    padding: 0 !important;
    margin: 0 !important;
    min-height: 100vh;
    background: transparent;
}

/* Direct override for main when it contains auth-container */
main .auth-container {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        padding: 1rem;
    }

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

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

    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-input {
        padding: 0.75rem 0.875rem 0.75rem 2.5rem;
        font-size: 0.9375rem;
    }

    .input-icon {
        left: 0.875rem;
        font-size: 0.9375rem;
    }
}

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

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

    .auth-subtitle {
        font-size: 0.875rem;
    }

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