/**
 * Auth Pages Stylesheet
 * Shared styles for login, forgot password, reset password, etc.
 * No Bootstrap dependency - pure CSS
 */

:root {
    --auth-bg-primary: #0a0f1a;
    --auth-bg-secondary: #111827;
    --auth-surface: #1f2937;
    --auth-surface-elevated: #374151;
    --auth-accent: #10b981;
    --auth-accent-light: #34d399;
    --auth-accent-glow: rgba(16, 185, 129, 0.4);
    --auth-text: #f9fafb;
    --auth-text-muted: #9ca3af;
    --auth-border: rgba(255, 255, 255, 0.08);
    --auth-font-display: 'Sora', sans-serif;
    --auth-font-body: 'Outfit', sans-serif;
    --auth-radius-lg: 1.25rem;
    --auth-radius-md: 0.75rem;
    --auth-shadow-glow: 0 0 60px var(--auth-accent-glow);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base */
.auth-page {
    font-family: var(--auth-font-body);
    background: var(--auth-bg-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: hidden;
    position: relative;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated background gradient */
.auth-bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(16, 185, 129, 0.15), transparent),
        radial-gradient(ellipse 60% 60% at 80% 20%, rgba(59, 130, 246, 0.1), transparent),
        radial-gradient(ellipse 50% 80% at 60% 80%, rgba(168, 85, 247, 0.08), transparent),
        var(--auth-bg-primary);
    z-index: 0;
}

/* Grid pattern overlay */
.auth-grid-pattern {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
}

/* Geometric floating shapes */
.auth-shape {
    position: fixed;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-md);
    opacity: 0.6;
    animation: auth-float 20s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

.auth-shape-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 5%;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), transparent);
    animation-delay: 0s;
}

.auth-shape-2 {
    width: 200px;
    height: 200px;
    top: 60%;
    right: 10%;
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.05), transparent);
    animation-delay: -5s;
    border-radius: 50%;
}

.auth-shape-3 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 15%;
    background: linear-gradient(225deg, rgba(168, 85, 247, 0.05), transparent);
    animation-delay: -10s;
}

.auth-shape-4 {
    width: 100px;
    height: 100px;
    top: 30%;
    right: 20%;
    background: linear-gradient(315deg, rgba(16, 185, 129, 0.08), transparent);
    animation-delay: -15s;
    border-radius: 50%;
}

@keyframes auth-float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(20px, -30px) rotate(5deg);
    }
    50% {
        transform: translate(-10px, 20px) rotate(-3deg);
    }
    75% {
        transform: translate(15px, 10px) rotate(2deg);
    }
}

/* Card wrapper */
.auth-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
}

/* Main card */
.auth-card {
    background: rgba(31, 41, 55, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-lg);
    padding: 2.5rem;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        var(--auth-shadow-glow);
    animation: auth-slideUp 0.6s ease-out forwards;
    opacity: 0;
}

@keyframes auth-slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
    animation: auth-fadeIn 0.6s ease-out 0.2s forwards;
    opacity: 0;
}

@keyframes auth-fadeIn {
    to {
        opacity: 1;
    }
}

/* Logo icon */
.auth-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent-light));
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    box-shadow: 0 8px 32px var(--auth-accent-glow);
    position: relative;
}

.auth-logo::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 1.125rem;
    background: linear-gradient(135deg, var(--auth-accent-light), var(--auth-accent));
    z-index: -1;
    opacity: 0.5;
    filter: blur(8px);
}

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

/* Headings */
.auth-title {
    font-family: var(--auth-font-display);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    color: var(--auth-text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Alerts */
.auth-alert {
    border-radius: var(--auth-radius-md);
    padding: 0.875rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    animation: auth-fadeIn 0.4s ease-out forwards;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.auth-alert-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--auth-accent-light);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.auth-alert-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.auth-alert-info {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.auth-alert-content {
    flex: 1;
}

.auth-alert-close {
    background: none;
    border: none;
    color: currentColor;
    opacity: 0.5;
    cursor: pointer;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
    transition: opacity 0.2s ease;
}

.auth-alert-close:hover {
    opacity: 1;
}

/* Form elements */
.auth-form-group {
    margin-bottom: 1.25rem;
    animation: auth-fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

.auth-form-group:nth-child(1) { animation-delay: 0.3s; }
.auth-form-group:nth-child(2) { animation-delay: 0.4s; }
.auth-form-group:nth-child(3) { animation-delay: 0.5s; }
.auth-form-group:nth-child(4) { animation-delay: 0.6s; }

.auth-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--auth-text-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 0.025em;
}

.auth-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-family: var(--auth-font-body);
    font-size: 1rem;
    color: var(--auth-text);
    background: var(--auth-bg-secondary);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-md);
    transition: all 0.2s ease;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px var(--auth-accent-glow);
    background: var(--auth-surface);
}

.auth-input::placeholder {
    color: var(--auth-text-muted);
    opacity: 0.6;
}

/* Input group (for password toggle) */
.auth-input-group {
    position: relative;
    display: flex;
}

.auth-input-group .auth-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.auth-input-group .auth-input:focus {
    border-color: var(--auth-accent);
}

.auth-input-group .auth-input:focus + .auth-input-toggle {
    border-color: var(--auth-accent);
}

.auth-input-toggle {
    background: var(--auth-bg-secondary);
    border: 1px solid var(--auth-border);
    border-left: none;
    border-top-right-radius: var(--auth-radius-md);
    border-bottom-right-radius: var(--auth-radius-md);
    padding: 0 1rem;
    color: var(--auth-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.auth-input-toggle:hover {
    color: var(--auth-text);
    background: var(--auth-surface);
}

/* Checkbox */
.auth-checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.5rem;
}

.auth-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    background: var(--auth-bg-secondary);
    border: 1px solid var(--auth-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    accent-color: var(--auth-accent);
}

.auth-checkbox:checked {
    background: var(--auth-accent);
    border-color: var(--auth-accent);
}

.auth-checkbox:focus {
    box-shadow: 0 0 0 3px var(--auth-accent-glow);
    outline: none;
}

.auth-checkbox-label {
    font-size: 0.9rem;
    color: var(--auth-text-muted);
    cursor: pointer;
    user-select: none;
}

/* Submit button */
.auth-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-family: var(--auth-font-body);
    font-size: 1rem;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, var(--auth-accent), #059669);
    border: none;
    border-radius: var(--auth-radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: auth-fadeIn 0.5s ease-out 0.7s forwards;
    opacity: 0;
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--auth-accent-glow);
}

.auth-btn:hover::before {
    left: 100%;
}

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

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--auth-border);
    animation: auth-fadeIn 0.5s ease-out 0.8s forwards;
    opacity: 0;
}

.auth-link {
    color: var(--auth-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-link:hover {
    color: var(--auth-accent-light);
}

.auth-link i {
    transition: transform 0.2s ease;
}

.auth-link:hover i.fa-arrow-left {
    transform: translateX(-3px);
}

/* Error messages */
.auth-error {
    display: block;
    font-size: 0.8rem;
    color: #fca5a5;
    margin-top: 0.375rem;
}

/* Hint text */
.auth-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--auth-text-muted);
    margin-top: 0.375rem;
    opacity: 0.8;
}

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

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

    .auth-shape {
        display: none;
    }
}

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