/* ========================================
   AUTH LAYOUT COMPONENT STYLES
   ======================================== */

/* CSS Variables for Auth Layout */
:root {
    --auth-bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --auth-bg-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.3)), 
                     url('/images/hero-forest-background.jpg?v=20250913');
    --auth-card-bg: rgba(255, 255, 255, 0.95);
    --auth-card-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    --auth-card-border-radius: 12px;
    --auth-card-padding: 3rem;
    --auth-card-max-width: 500px;
    --auth-title-size: 2rem;
    --auth-subtitle-size: 1rem;
}

/* ========================================
   MAIN AUTH CONTAINER STYLES
   ======================================== */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-bg-gradient);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    padding: var(--space-8);
    position: relative;
    overflow: hidden;
}

/* Enhanced background for login/register pages */
.auth-container.enhanced-bg {
    background: var(--auth-bg-image);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* Background overlay effects */
.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(242, 116, 10, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* ========================================
   AUTH CARD STYLES
   ======================================== */

.auth-card {
    background: var(--auth-card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--auth-card-border-radius);
    box-shadow: var(--auth-card-shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: var(--auth-card-padding);
    width: 100%;
    max-width: var(--auth-card-max-width);
    position: relative;
    overflow: hidden;
}

/* Card overlay effect */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

/* ========================================
   AUTH HEADER STYLES
   ======================================== */

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-title {
    font-size: var(--auth-title-size);
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.auth-subtitle {
    color: #6b7280;
    font-size: var(--auth-subtitle-size);
    line-height: 1.5;
    margin-bottom: 0;
}

/* ========================================
   AUTH FORM STYLES
   ======================================== */

.auth-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input.error,
.form-input-error {
    border-color: #ef4444;
}

.form-error {
    display: block;
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* ========================================
   AUTH BUTTON STYLES
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    margin-bottom: 1rem;
}

.btn-primary {
    background: #6366f1;
    color: white;
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

/* ========================================
   AUTH LINKS STYLES
   ======================================== */

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-links a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-links a:hover {
    color: #4f46e5;
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-link-text {
    margin-bottom: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.auth-link {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* ========================================
   PASSWORD TOGGLE STYLES
   ======================================== */

.password-input-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6b7280;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #374151;
}

.eye-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* ========================================
   DROPDOWN STYLES (for register page)
   ======================================== */

/* Enhanced dropdown styling */
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.form-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-select:hover {
    border-color: #d1d5db;
}

.form-select option {
    padding: 0.5rem;
}

/* ========================================
   RADIO GROUP STYLES (for register page) - DEPRECATED
   ======================================== */

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    overflow: hidden;
}

.radio-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    margin: 0;
}

.radio-label:last-child {
    border-bottom: none;
}

.radio-label:hover {
    background: #f8fafc;
}

.radio-label:first-child {
    border-radius: 6px 6px 0 0;
}

.radio-label:last-child {
    border-radius: 0 0 6px 6px;
}

.radio-label input[type="radio"] {
    display: none;
}

/* Removed duplicate radio-custom styles - using enhanced styles below */

/* Removed duplicate radio button styles - using enhanced styles below */

.radio-label input[type="radio"]:checked ~ .radio-content {
    color: #1f2937;
}

/* Selected radio button styling - more compatible approach */
.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #6366f1 !important;
    background: #6366f1 !important;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 8px !important;
    height: 8px !important;
    background: white !important;
    border-radius: 50% !important;
}

/* Selected label background - using JavaScript class approach */
.radio-label.selected {
    background: #f0f4ff !important;
}

.radio-label.selected .radio-custom {
    border-color: #6366f1 !important;
    background: #6366f1 !important;
}

.radio-label.selected .radio-custom::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 8px !important;
    height: 8px !important;
    background: white !important;
    border-radius: 50% !important;
    display: block !important;
}

/* Ensure radio buttons are visible and properly styled */
.radio-custom {
    width: 20px !important;
    height: 20px !important;
    border: 2px solid #d1d5db !important;
    border-radius: 50% !important;
    position: relative !important;
    flex-shrink: 0 !important;
    margin-top: 2px !important;
    transition: all 0.3s ease !important;
    background: white !important;
    display: block !important;
    min-width: 20px !important;
    min-height: 20px !important;
    box-sizing: border-box !important;
}

.radio-label:hover .radio-custom {
    border-color: #6366f1 !important;
}

.radio-content strong {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.radio-content small {
    color: #6b7280;
    font-size: 0.875rem;
}

/* ========================================
   CHECKBOX GRID STYLES (for register page)
   ======================================== */

/* Removed duplicate checkbox styles - using registration-specific styles below */

/* ========================================
   INDIVIDUAL FIELDS STYLES (for register page)
   ======================================== */

.individual-fields {
    display: none;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.individual-fields.show {
    display: block;
}

/* ========================================
   CHECKBOX STYLES (for login page)
   ======================================== */

.form-group-checkbox {
    display: flex;
    align-items: center;
}

/* Removed duplicate checkbox styles - using registration-specific styles below */

/* ========================================
   AUTH DIVIDER STYLES
   ======================================== */

.auth-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.auth-divider span {
    background: white;
    padding: 0 1rem;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* ========================================
   SOCIAL LOGIN BUTTONS STYLES
   ======================================== */

.social-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-google {
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.btn-google:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: #1f2937;
}

.btn-google svg {
    flex-shrink: 0;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .auth-container {
        padding: 1rem;
    }
    
    .auth-card {
        padding: 2rem;
        max-width: 100%;
    }
    
    .auth-title {
        font-size: 1.75rem;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .radio-group {
        gap: 0.75rem;
    }
    
    .radio-label {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 0.5rem;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .form-input {
        padding: 0.625rem 0.875rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
    }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .auth-container,
    .auth-card,
    .form-input,
    .btn,
    .radio-label,
    .checkbox-item {
        transition: none;
    }
    
    .btn:hover {
        transform: none;
    }
}

@media (prefers-contrast: high) {
    .auth-card {
        border: 2px solid #000;
    }
    
    .form-input {
        border-width: 2px;
    }
    
    .form-input:focus {
        border-width: 3px;
    }
}

/* ========================================
   REGISTRATION-SPECIFIC STYLES
   ======================================== */

/* Username input with @ prefix */
.username-input-group {
    position: relative;
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
}

.username-input-group:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.username-prefix {
    padding: 0.75rem 0.5rem 0.75rem 1rem;
    color: #6b7280;
    font-weight: 600;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    border-radius: 6px 0 0 6px;
    flex-shrink: 0;
}

.username-input-group .form-input {
    border: none;
    border-radius: 0;
    flex: 1;
    padding-left: 0.5rem;
}

.check-availability-btn {
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.check-availability-btn:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

.check-availability-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.username-availability {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.username-availability.available {
    color: #059669;
}

.username-availability.unavailable {
    color: #dc2626;
}

.username-availability.checking {
    color: #f59e0b;
}

/* Registration Checkbox Grid Layout */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* Registration Checkbox Labels - More Specific Selector */
.auth-container .checkbox-label {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.75rem !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    background: white !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
}

.auth-container .checkbox-label:hover {
    border-color: #6366f1 !important;
    background: #f8fafc !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.auth-container .checkbox-label input[type="checkbox"] {
    display: none !important;
}

/* Registration Custom Checkbox Styling - More Specific Selector */
.auth-container .checkbox-custom {
    width: 20px !important;
    height: 20px !important;
    border: 2px solid #d1d5db !important;
    border-radius: 4px !important;
    background: white !important;
    position: relative !important;
    flex-shrink: 0 !important;
    transition: all 0.2s ease !important;
}

.auth-container .checkbox-label:hover .checkbox-custom {
    border-color: #6366f1 !important;
    background: #f0f4ff !important;
}

.auth-container .checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: #6366f1 !important;
    border-color: #6366f1 !important;
}

.auth-container .checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '' !important;
    position: absolute !important;
    top: 2px !important;
    left: 6px !important;
    width: 6px !important;
    height: 10px !important;
    border: solid white !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg) !important;
}

.auth-container .checkbox-label input[type="checkbox"]:focus + .checkbox-custom {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

/* Business-specific fields */
.business-fields {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.business-fields.show {
    display: block;
}

/* Notification settings */
.notification-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.notification-setting {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-setting:hover {
    border-color: #6366f1;
    background: #f8fafc;
}

.notification-setting input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
}

.notification-setting label {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .auth-container {
        background: white !important;
        min-height: auto;
        padding: 0;
    }
    
    .auth-card {
        box-shadow: none;
        border: 1px solid #000;
        background: white;
    }
    
    .btn {
        border: 1px solid #000;
        background: white;
        color: #000;
    }
}
