/* =========================
   FREELANCER AUTH STYLES
   ========================= */

/* CSS Variables & Themes */
:root {
    /* Brand Colors - Strict adherence */
    --brand-blue: #2563eb;
    --brand-yellow: #f59e0b;
    --brand-white: #ffffff;
    
    /* Light Theme */
    --bg-primary: var(--brand-white);
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --error-color: #ef4444;
    --success-color: #10b981;
}

[data-theme="dark"] {
    /* Dark Theme - Adjusted for accessibility */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --error-color: #f87171;
    --success-color: #34d399;
}

/* =========================
   BASE STYLES
   ========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-yellow) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* =========================
   AUTH CONTAINERS
   ========================= */
.signup-container,
.login-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.auth-card {
    background: var(--bg-primary);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* =========================
   AUTH HEADER
   ========================= */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* =========================
   AUTH FORM
   ========================= */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-input,
.form-select,
.form-file {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-input:focus,
.form-select:focus,
.form-file:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

/* Multiple Select Styling */
.form-select[multiple] {
    height: 120px;
    padding: 0.75rem;
}

.form-select[multiple] option {
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.form-select[multiple] option:hover {
    background-color: var(--brand-blue);
    color: var(--brand-white);
}

.form-select[multiple] option:checked {
    background-color: var(--brand-blue);
    color: var(--brand-white);
}

/* File Input Styling */
.form-file {
    cursor: pointer;
}

.form-file::-webkit-file-upload-button {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    margin-right: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-file::-webkit-file-upload-button:hover {
    background: var(--bg-tertiary);
}

/* =========================
   SUBMIT BUTTON
   ========================= */
.submit-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-yellow));
    color: var(--brand-white);
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(37, 99, 235, 0.3);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--brand-white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* =========================
   AUTH FOOTER
   ========================= */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

.auth-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* =========================
   PASSWORD STRENGTH INDICATOR
   ========================= */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-fill.weak {
    width: 33%;
    background: var(--error-color);
}

.strength-fill.medium {
    width: 66%;
    background: var(--warning-color);
}

.strength-fill.strong {
    width: 100%;
    background: var(--success-color);
}

.strength-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* =========================
   FORM VALIDATION STYLES
   ========================= */
.form-input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: var(--error-color);
}

.form-input:valid:not(:focus):not(:placeholder-shown) {
    border-color: var(--success-color);
}

.error-message {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

.form-input:invalid:not(:focus):not(:placeholder-shown) + .error-message {
    display: block;
}

/* =========================
   ANIMATIONS
   ========================= */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.auth-card {
    animation: slideUp 0.6s ease;
}

/* =========================
   FREELANCER-SPECIFIC STYLES
   ========================= */

/* Skills Selection Enhancement */
.skills-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Tone Selection Styling */
.tone-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

.tone-option:hover {
    background-color: var(--bg-secondary);
}

/* Progress Indicator for Multi-step Forms */
.form-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.form-progress::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color);
    transform: translateY(-50%);
    z-index: 1;
}

.progress-step {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.progress-step.active {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: var(--brand-white);
}

.progress-step.completed {
    background: var(--success-color);
    border-color: var(--success-color);
    color: var(--brand-white);
}

/* =========================
   RESPONSIVE DESIGN
   ========================= */
@media (max-width: 768px) {
    .signup-container,
    .login-container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
    }
    
    .auth-header h1 {
        font-size: 1.75rem;
    }
    
    .auth-header p {
        font-size: 1rem;
    }
    
    .form-input,
    .form-select,
    .form-file {
        padding: 0.75rem;
    }
    
    .submit-btn {
        padding: 0.875rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem 1rem;
    }
    
    .auth-header h1 {
        font-size: 1.5rem;
    }
    
    .auth-form {
        gap: 1rem;
    }
    
    .form-group label {
        font-size: 0.85rem;
    }
}

/* =========================
   ACCESSIBILITY
   ========================= */
@media (prefers-reduced-motion: reduce) {
    .auth-card,
    .submit-btn,
    .form-input,
    .form-select {
        animation: none;
        transition: none;
    }
}

.form-input:focus-visible,
.form-select:focus-visible,
.form-file:focus-visible,
.submit-btn:focus-visible,
.auth-link:focus-visible {
    outline: 2px solid var(--brand-blue);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .auth-card {
        border-width: 2px;
    }
    
    .form-input,
    .form-select,
    .form-file {
        border-width: 2px;
    }
}

/* =========================
   UTILITY CLASSES
   ========================= */
.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mt-2 {
    margin-top: 2rem;
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================
   LOADING STATES
   ========================= */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-tertiary);
    border-top: 4px solid var(--brand-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* =========================
   SUCCESS/ERROR STATES
   ========================= */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert.show {
    display: block;
    animation: slideUp 0.3s ease;
}

/* Skills Checkbox Container */
.skills-checkbox-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  max-height: 200px;
  overflow-y: auto;
  padding: 15px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  margin-top: 5px;
}

.skill-checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--brand-blue);
}

.skill-label {
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.95rem;
  user-select: none;
}

.skill-checkbox:checked + .skill-label {
  color: var(--brand-blue);
  font-weight: 500;
}

/* Remove old select multiple styles */
.form-select[multiple] {
  display: none;
}