/* ========================================
   CloudVault - Modern Auth Page Styles
   ======================================== */

/* CSS Variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #a855f7;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;

    --bg-dark: #09090b;
    --bg-card: rgba(255, 255, 255, 0.02);
    --bg-card-hover: rgba(255, 255, 255, 0.05);

    --text-primary: #fafafa;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.45);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.5);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 70px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 80px rgba(99, 102, 241, 0.15);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-xl: 24px;

    --transition-fast: 0.12s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-normal: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated Background */
.background {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    top: -200px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    bottom: -150px;
    right: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    opacity: 0.3;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(50px, -50px) scale(1.05);
    }
    50% {
        transform: translate(-30px, 30px) scale(0.95);
    }
    75% {
        transform: translate(-50px, -30px) scale(1.02);
    }
}

.grid-overlay {
    position: absolute;
    inset: 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;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

/* Floating Elements */
.floating-elements {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.float-icon {
    position: absolute;
    width: 48px;
    height: 48px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    animation: floatIcon 15s infinite ease-in-out;
}

.float-icon svg {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
}

.float-1 { top: 15%; left: 8%; animation-delay: 0s; }
.float-2 { top: 25%; right: 5%; animation-delay: -3s; }
.float-3 { bottom: 30%; left: 5%; animation-delay: -6s; }
.float-4 { bottom: 15%; right: 12%; animation-delay: -9s; }
.float-5 { top: 60%; left: 15%; animation-delay: -12s; }

@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.4;
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
        opacity: 0.7;
    }
}

/* Main Container */
.container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Branding Section */
.branding-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 40px 60px;
    max-width: 55%;
}

.logo-container {
    margin-bottom: 60px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.branding-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 560px;
}

.headline {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subheadline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 48px;
    max-width: 480px;
}

/* Features */
.features {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 48px;
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.feature:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-focus);
    transform: translateX(8px);
}

.feature-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feature-text strong {
    font-size: 0.95rem;
    font-weight: 600;
}

.feature-text span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Stats */
.stats {
    display: flex;
    gap: 40px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.stat-suffix {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Auth Section */
.auth-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    max-width: 45%;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg), var(--shadow-glow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* Form Styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: color var(--transition-fast);
    z-index: 2;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    outline: none;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-wrapper input:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.input-wrapper input:focus {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.input-wrapper input:focus ~ .input-icon,
.input-wrapper input:focus + .input-icon {
    color: var(--primary);
}

.input-focus-effect {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.input-wrapper input:focus ~ .input-focus-effect {
    opacity: 1;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-fast);
    z-index: 2;
}

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

.password-toggle svg {
    width: 20px;
    height: 20px;
}

/* Password Strength */
.password-strength {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-card);
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    background: var(--error);
    border-radius: 2px;
    transition: all var(--transition-normal);
}

.strength-fill.weak { width: 33%; background: var(--error); }
.strength-fill.medium { width: 66%; background: var(--warning); }
.strength-fill.strong { width: 100%; background: var(--success); }

.strength-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 100px;
}

/* Form Options */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.checkbox-wrapper input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    position: relative;
    transition: all var(--transition-fast);
}

.checkbox-wrapper input:checked + .checkmark {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
}

.checkmark::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.checkbox-wrapper input:checked + .checkmark::after {
    opacity: 1;
}

.checkbox-wrapper a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.checkbox-wrapper a:hover {
    color: var(--accent);
}

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

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

/* Primary Button */
.btn-primary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-normal);
    margin-top: 8px;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
}

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

.btn-text,
.btn-arrow {
    position: relative;
    z-index: 1;
}

.btn-arrow {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-fast);
}

.btn-primary:hover .btn-arrow {
    transform: translateX(4px);
}

.btn-loader {
    display: none;
    position: relative;
    z-index: 1;
}

.btn-primary.loading .btn-text,
.btn-primary.loading .btn-arrow {
    display: none;
}

.btn-primary.loading .btn-loader {
    display: block;
}

.spinner {
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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


/* Auth Footer */
.auth-footer {
    margin-top: 28px;
    text-align: center;
}

.auth-footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.security-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.badge svg {
    width: 14px;
    height: 14px;
    color: var(--success);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 48px;
    text-align: center;
    max-width: 400px;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon.success {
    background: linear-gradient(135deg, var(--success), #059669);
}

.modal-icon.error {
    background: linear-gradient(135deg, var(--error), #dc2626);
}

.modal-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.btn-modal-close {
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-modal-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.progress-bar {
    height: 4px;
    background: var(--bg-card);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    animation: progressFill 2s ease-out forwards;
}

@keyframes progressFill {
    to { width: 100%; }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .headline {
        font-size: 2.75rem;
    }

    .branding-section {
        padding: 32px 40px;
    }
}

@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    .branding-section,
    .auth-section {
        max-width: 100%;
    }

    .branding-section {
        padding: 32px 24px;
        order: 2;
    }

    .auth-section {
        padding: 40px 24px 24px;
        order: 1;
    }

    .branding-content {
        max-width: 100%;
        text-align: center;
        align-items: center;
    }

    .headline {
        font-size: 2.25rem;
    }

    .subheadline {
        max-width: 100%;
    }

    .features {
        max-width: 500px;
    }

    .stats {
        justify-content: center;
    }

    .floating-elements {
        display: none;
    }
}

@media (max-width: 640px) {
    .auth-card {
        padding: 28px 24px;
    }

    .headline {
        font-size: 1.875rem;
    }

    .form-row {
        flex-direction: column;
        gap: 20px;
    }

    .stats {
        flex-wrap: wrap;
        gap: 24px;
    }

    .stat {
        flex: 0 0 calc(50% - 12px);
        text-align: center;
    }

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

    .social-btn span {
        display: inline;
    }

    .security-badges {
        flex-direction: column;
        gap: 8px;
    }
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible,
input:focus-visible {
    outline: none;
}

/* Selection color */
::selection {
    background: rgba(102, 126, 234, 0.3);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
