/* Tangled - Modern Authentication Pages */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Modern Color Palette */
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #818CF8;
    --secondary: #10B981;
    --danger: #EF4444;
    --success: #10B981;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-bg: linear-gradient(135deg, #667eea15 0%, #764ba215 50%, #f093fb15 100%);
    
    /* Neutral Colors */
    --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-800: #1F2937;
    --gray-900: #111827;
    
    /* Shadows */
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--gradient-bg);
    min-height: 100vh;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* Background decorations */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 800px;
    height: 800px;
    background: var(--gradient-primary);
    border-radius: 50%;
    opacity: 0.1;
    filter: blur(100px);
    z-index: 0;
    pointer-events: none;
}

body::before {
    top: -50%;
    right: -20%;
}

body::after {
    bottom: -50%;
    left: -20%;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    position: relative;
    z-index: 1;
    overflow-y: auto;
}

.auth-box {
    background: white;
    border-radius: 24px;
    padding: 48px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--gray-100);
    margin: auto;
}

.auth-box-wide {
    max-width: 640px;
}

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

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-logo i {
    font-size: 36px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-logo span {
    font-size: 32px;
    font-weight: 800;
    color: var(--gray-900);
}

.auth-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.auth-header p {
    color: var(--gray-600);
    font-size: 16px;
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.3s ease-out;
}

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

.alert i {
    font-size: 20px;
    flex-shrink: 0;
}

.alert-error {
    background: #FEE2E2;
    color: var(--danger);
    border: 1px solid #FECACA;
}

.alert-success {
    background: #D1FAE5;
    color: var(--success);
    border: 1px solid #A7F3D0;
}

/* Forms */
.auth-form {
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: -24px;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s;
}

.form-group:focus-within::before {
    opacity: 1;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 10px;
    font-size: 15px;
}

.form-label i {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: 6px;
    color: white;
    font-size: 11px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 16px;
    color: var(--gray-900);
    background: white;
    transition: all 0.3s;
    min-height: 48px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

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

.form-control:focus {
    outline: none;
    border-color: transparent;
    background: linear-gradient(white, white) padding-box,
                var(--gradient-primary) border-box;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

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

/* Input groups for workspace URL */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: 10px 0 0 10px;
    flex: 1;
}

.input-group-append {
    display: flex;
    align-items: center;
    padding: 0 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 2px solid var(--gray-200);
    border-left: none;
    border-radius: 0 10px 10px 0;
    color: var(--gray-600);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
}

.input-group .form-control:focus + .input-group-append {
    border-color: transparent;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 48px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.btn-primary {
    width: 100%;
    background: var(--gradient-primary);
    background-size: 200% 200%;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

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

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

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

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

.btn-outline {
    width: 100%;
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Links */
.auth-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.auth-footer p {
    color: var(--gray-600);
    font-size: 15px;
}

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

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

.auth-links {
    margin-top: 24px;
    text-align: center;
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s;
}

.auth-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Back to home link */
.back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 24px;
    transition: color 0.2s;
}

.back-home:hover {
    color: var(--primary);
}

.back-home i {
    font-size: 16px;
}

/* Form help text */
.form-text {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 6px;
}

/* Responsive */
@media (max-width: 640px) {
    .auth-box {
        padding: 32px 24px;
    }
    
    .auth-header h1 {
        font-size: 28px;
    }
    
    .auth-logo span {
        font-size: 28px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Form Row for side-by-side fields */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 0;
}

/* Add floating placeholder effect */
.form-group {
    position: relative;
}

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

.form-control:focus::placeholder {
    transform: translateY(-4px);
    opacity: 0.5;
    font-size: 14px;
}

/* Add success state for filled inputs */
.form-control:valid:not(:placeholder-shown) {
    border-color: var(--secondary);
    background-color: rgba(16, 185, 129, 0.03);
}

.form-control:valid:not(:placeholder-shown) + .input-group-append {
    border-color: var(--secondary);
    background: rgba(16, 185, 129, 0.05);
    color: var(--secondary);
}

/* Password strength indicator */
input[type="password"]:focus {
    border-image-slice: 1;
}
