/* =====================================================
   BUNDLY - Authentication Pages
   Modern, Minimalistic Design System
   ===================================================== */

/* CSS Reset for Auth Pages */
.auth-body,
.auth-body *,
.auth-body *::before,
.auth-body *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.auth-body {
    min-height: 100vh;
}

.auth-body ul,
.auth-body ol {
    list-style: none;
}

.auth-body a {
    text-decoration: none;
    color: inherit;
}

.auth-body input,
.auth-body button,
.auth-body textarea,
.auth-body select {
    font: inherit;
}

.auth-body img,
.auth-body svg {
    display: block;
    max-width: 100%;
}

.auth-body button {
    cursor: pointer;
}

/* CSS Variables */
:root {
    --auth-primary: #4F46E5;
    --auth-primary-hover: #4338CA;
    --auth-primary-light: rgba(79, 70, 229, 0.1);
    --auth-secondary: #0EA5E9;
    --auth-success: #10B981;
    --auth-warning: #F59E0B;
    --auth-error: #EF4444;
    --auth-text-primary: #1F2937;
    --auth-text-secondary: #6B7280;
    --auth-text-muted: #9CA3AF;
    --auth-border: #E5E7EB;
    --auth-border-focus: #4F46E5;
    --auth-bg-primary: #FFFFFF;
    --auth-bg-secondary: #F9FAFB;
    --auth-bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --auth-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --auth-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --auth-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --auth-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --auth-radius-sm: 0.375rem;
    --auth-radius-md: 0.5rem;
    --auth-radius-lg: 0.75rem;
    --auth-radius-xl: 1rem;
    --auth-transition: all 0.2s ease-in-out;
}

/* Base Layout */
.auth-body {
    min-height: 100vh;
    display: flex;
    background: var(--auth-bg-gradient);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Split Layout Container */
.auth-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Left Panel - Branding */
.auth-brand-panel {
    flex: 1;
    display: none;
    background: var(--auth-bg-gradient);
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-5%, -5%); }
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
}

.auth-brand-logo {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.auth-brand-tagline {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 3rem;
    line-height: 1.6;
}

.auth-brand-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-brand-features li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    font-size: 1rem;
    opacity: 0.9;
}

.auth-brand-features li svg {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
}

/* Right Panel - Form */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--auth-bg-primary);
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

/* Logo */
.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    text-decoration: none;
}

.auth-logo-text {
    font-size: 2rem;
    font-weight: 800;
    background: var(--auth-bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--auth-text-primary);
    margin: 0 0 0.5rem;
    letter-spacing: -0.025em;
}

.auth-header p {
    color: var(--auth-text-secondary);
    font-size: 0.9375rem;
    margin: 0;
}

/* Alerts */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--auth-radius-lg);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.auth-alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #065F46;
}

.auth-alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #991B1B;
}

.auth-alert-info {
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.2);
    color: #0C4A6E;
}

.auth-alert svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* Form Card */
.auth-card {
    background: var(--auth-bg-primary);
    border-radius: var(--auth-radius-xl);
    padding: 0;
}

/* Form Elements */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-text-primary);
}

.form-group label .required {
    color: var(--auth-error);
    margin-left: 0.125rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Input Fields */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    color: var(--auth-text-primary);
    background: var(--auth-bg-primary);
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-md);
    transition: var(--auth-transition);
    outline: none;
}

.form-input::placeholder {
    color: var(--auth-text-muted);
}

.form-input:hover {
    border-color: #D1D5DB;
}

.form-input:focus {
    border-color: var(--auth-border-focus);
    box-shadow: 0 0 0 3px var(--auth-primary-light);
}

.form-input.is-invalid {
    border-color: var(--auth-error);
}

.form-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Input with Icon */
.input-group {
    position: relative;
}

.input-group .form-input {
    padding-left: 2.75rem;
}

.input-group .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: var(--auth-text-muted);
    pointer-events: none;
    display: block;
}

.input-group .input-action {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--auth-text-muted);
    transition: var(--auth-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-group .input-action:hover {
    color: var(--auth-text-secondary);
}

.input-group .input-action svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Textarea */
textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

/* Select */
select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239CA3AF'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

/* Form Helper Text */
.form-hint {
    font-size: 0.75rem;
    color: var(--auth-text-muted);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.75rem;
    color: var(--auth-error);
    margin-top: 0.25rem;
}

/* Checkbox */
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.125rem;
    cursor: pointer;
    accent-color: var(--auth-primary);
}

.form-checkbox span {
    font-size: 0.875rem;
    color: var(--auth-text-secondary);
    line-height: 1.5;
}

.form-checkbox a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
}

.form-checkbox a:hover {
    text-decoration: underline;
}

/* Form Options Row */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forgot-link {
    font-size: 0.875rem;
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--auth-transition);
}

.forgot-link:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

/* Submit Button */
.btn-auth {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: white;
    background: var(--auth-primary);
    border: none;
    border-radius: var(--auth-radius-md);
    cursor: pointer;
    transition: var(--auth-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-auth:hover {
    background: var(--auth-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--auth-shadow-md);
}

.btn-auth:active {
    transform: translateY(0);
}

.btn-auth:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-auth svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Secondary Button */
.btn-auth-secondary {
    background: white;
    color: var(--auth-text-primary);
    border: 1.5px solid var(--auth-border);
}

.btn-auth-secondary:hover {
    background: var(--auth-bg-secondary);
    border-color: #D1D5DB;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

.auth-divider span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--auth-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Auth Links */
.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-links p {
    font-size: 0.875rem;
    color: var(--auth-text-secondary);
    margin: 0.5rem 0;
}

.auth-links a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--auth-transition);
}

.auth-links a:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--auth-border);
}

.auth-footer p {
    font-size: 0.75rem;
    color: var(--auth-text-muted);
    margin: 0;
}

/* =====================================================
   MULTI-STEP FORM (Vendor Registration)
   ===================================================== */

.multi-step-wrapper {
    width: 100%;
}

/* When using multi-step-wrapper, make the container wider */
.auth-card:has(.multi-step-wrapper) {
    max-width: none;
}

.auth-container:has(.multi-step-wrapper) {
    max-width: 520px;
}

/* Fallback for older browsers - also keep original selector */
.auth-container.multi-step {
    max-width: 520px;
}

/* Progress Indicator */
.step-progress {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.step-progress-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
}

.step-progress-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 1.25rem;
    left: 60%;
    width: 80%;
    height: 2px;
    background: var(--auth-border);
    transition: var(--auth-transition);
}

.step-progress-item.completed:not(:last-child)::after {
    background: var(--auth-success);
}

.step-progress-item.active:not(:last-child)::after {
    background: linear-gradient(90deg, var(--auth-primary) 50%, var(--auth-border) 50%);
}

.step-number {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--auth-bg-secondary);
    color: var(--auth-text-muted);
    border: 2px solid var(--auth-border);
    transition: var(--auth-transition);
    position: relative;
    z-index: 1;
}

.step-progress-item.active .step-number {
    background: var(--auth-primary);
    color: white;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px var(--auth-primary-light);
}

.step-progress-item.completed .step-number {
    background: var(--auth-success);
    color: white;
    border-color: var(--auth-success);
}

.step-progress-item.completed .step-number::after {
    content: '✓';
}

.step-progress-item.completed .step-number span {
    display: none;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--auth-text-muted);
    margin-top: 0.5rem;
    text-align: center;
    transition: var(--auth-transition);
}

.step-progress-item.active .step-label,
.step-progress-item.completed .step-label {
    color: var(--auth-text-primary);
}

/* Step Content */
.step-content {
    display: none;
}

.step-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Step Header */
.step-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.step-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--auth-text-primary);
    margin: 0 0 0.5rem;
}

.step-header p {
    font-size: 0.875rem;
    color: var(--auth-text-secondary);
    margin: 0;
}

/* Step Navigation */
.step-navigation {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-step {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--auth-radius-md);
    cursor: pointer;
    transition: var(--auth-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-step-back {
    background: white;
    color: var(--auth-text-secondary);
    border: 1.5px solid var(--auth-border);
}

.btn-step-back:hover {
    background: var(--auth-bg-secondary);
    color: var(--auth-text-primary);
}

.btn-step-next {
    background: var(--auth-primary);
    color: white;
    border: none;
}

.btn-step-next:hover {
    background: var(--auth-primary-hover);
}

.btn-step svg {
    width: 1rem;
    height: 1rem;
}

/* Category Selection */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.category-option {
    position: relative;
}

.category-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.category-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-md);
    cursor: pointer;
    transition: var(--auth-transition);
    text-align: center;
}

.category-option label:hover {
    border-color: var(--auth-primary);
    background: var(--auth-primary-light);
}

.category-option input:checked + label {
    border-color: var(--auth-primary);
    background: var(--auth-primary-light);
    box-shadow: 0 0 0 2px var(--auth-primary-light);
}

.category-option svg {
    width: 2rem;
    height: 2rem;
    color: var(--auth-primary);
    margin-bottom: 0.5rem;
}

.category-option span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-text-primary);
}

/* Password Strength */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 4px;
    background: var(--auth-border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.strength-fill {
    height: 100%;
    width: 0;
    transition: var(--auth-transition);
    border-radius: 2px;
}

.strength-fill.weak { width: 25%; background: var(--auth-error); }
.strength-fill.fair { width: 50%; background: var(--auth-warning); }
.strength-fill.good { width: 75%; background: var(--auth-secondary); }
.strength-fill.strong { width: 100%; background: var(--auth-success); }

.strength-text {
    font-size: 0.75rem;
    color: var(--auth-text-muted);
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

@media (min-width: 1024px) {
    .auth-brand-panel {
        display: flex;
    }
    
    .auth-form-panel {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .auth-logo {
        display: none;
    }
}

@media (max-width: 640px) {
    .auth-form-panel {
        padding: 1.5rem;
    }
    
    .auth-container {
        max-width: 100%;
    }
    
    .auth-header h1 {
        font-size: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .step-progress {
        padding: 0;
    }
    
    .step-label {
        display: none;
    }
    
    .step-navigation {
        flex-direction: column-reverse;
    }
}

/* =====================================================
   LEGACY SUPPORT (for old layout)
   ===================================================== */

.auth-body:not(:has(.auth-wrapper)) {
    padding: 2rem 1rem;
    align-items: center;
    justify-content: center;
}

.auth-body:not(:has(.auth-wrapper)) .auth-container {
    max-width: 420px;
}

/* Alert styles for legacy layout */
.alert {
    padding: 1rem;
    border-radius: var(--auth-radius-lg);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #065F46;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #991B1B;
}
