/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

/* Split Screen Container */
.split-screen-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Left Panel - Image */
.left-panel {
    flex: 1;
    position: relative;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.image-overlay {
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    text-align: center;
    padding: 3rem;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    margin: 2rem;
}

.overlay-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.overlay-content .logo-overlay {
    height: 60px;
    width: auto;
}

.overlay-content p {
    font-size: 1.2rem;
    margin: 0;
    opacity: 0.9;
}

/* Right Panel - Form */
.right-panel {
    flex: 1;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 100vh;
}

.form-container {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
}

/* Logo */
.logo-container {
    text-align: center;
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: nowrap;
}

.logo {
    height: 60px;
    width: auto;
}

.logo-heading {
    font-size: 2rem;
    font-weight: 700;
    color: #4285f4;
    margin: 0;
    letter-spacing: 0.1rem;
    display: inline-block;
    white-space: nowrap;
    line-height: 1;
    vertical-align: middle;
    padding-left: 16px;
}

/* Form Header */
.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.form-header .subtitle {
    font-size: 1rem;
    color: #666;
    margin: 0;
}

/* Form Styles */
.signup-form {
    width: 100%;
}

/* Form Controls */
.form-label {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
}

.form-control {
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #ffffff;
}

.form-control:focus {
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
    outline: none;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-valid {
    border-color: #28a745;
}

/* Form Sections */
.form-section {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    background: #f8f9fa;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}

.form-section:hover {
    border-color: #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #dee2e6;
}

/* Enhanced form controls */
.form-floating > .form-control:focus,
.form-floating > .form-control:not(:placeholder-shown) {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-floating > label {
    color: #6c757d;
    font-weight: 500;
}

/* Input group enhancements */
.input-group .form-select {
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .form-control {
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    z-index: 3;
}

.input-group .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Tooltip icon styling */
.btn-link {
    color: #6c757d;
    text-decoration: none;
    border: none;
    background: none;
    padding: 0;
    vertical-align: top;
    margin-left: 0.25rem;
}

.btn-link:hover {
    color: #0d6efd;
}

/* Form text styling */
.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Bootstrap Dropdown Styles */
.dropdown-toggle {
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: calc(1.5rem + 1.5rem + 4px); /* line-height + padding + border */
}

.dropdown-toggle:focus {
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
    outline: none;
}

.dropdown-toggle.is-invalid,
.btn.dropdown-toggle.is-invalid {
    border-color: #dc3545 !important;
}

.dropdown-toggle.is-valid,
.btn.dropdown-toggle.is-valid {
    border-color: #28a745 !important;
}

.dropdown-menu {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    margin-top: 0.25rem;
    max-height: 250px;
    overflow-y: auto;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover,
.dropdown-menu .dropdown-item:hover,
.btn.is-valid + .dropdown-menu .dropdown-item:hover,
.btn.is-invalid + .dropdown-menu .dropdown-item:hover {
    color: #495057 !important;
    text-decoration: none !important;
}

.dropdown-item:active,
.dropdown-menu .dropdown-item:active,
.btn.is-valid + .dropdown-menu .dropdown-item:active,
.btn.is-invalid + .dropdown-menu .dropdown-item:active {
    background-color: #4285f4 !important;
    color: white !important;
}

/* Keyboard navigation highlight */
.dropdown-keyboard-highlight {
    background-color: #e3f2fd !important;
    color: #1976d2 !important;
    border-left: 3px solid #4285f4 !important;
    padding-left: calc(1rem - 3px) !important;
}

/* Input group dropdown adjustments */
.input-group .dropdown-toggle {
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .form-control {
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group .dropdown-toggle:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    z-index: 3;
}

/* Checkbox spacing */
.form-check {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.form-check-label {
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Country code select specific styling */
#countryCode {
    max-width: 120px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

#phone {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Mobile-specific improvements */
@media (max-width: 875px) {
    /* Hide left panel completely on mobile */
    .left-panel {
        display: none;
    }
    
    /* Make right panel take full width */
    .right-panel {
        flex: 1;
        width: 100%;
    }
    
    .form-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .section-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .form-container {
        padding: 1rem;
        max-width: 100%;
    }
    
    .input-group {
        flex-wrap: nowrap;
    }
    
    #countryCode {
        min-width: 100px;
        max-width: 110px;
    }
}

/* Desktop-specific styles */
@media (min-width: 876px) {
    /* Adjust form container spacing */
    .form-container {
        padding-top: 1rem;
    }
}

/* Checkbox */
.form-check {
    padding-left: 1.5rem;
}

.form-check-input {
    margin-top: 0.25rem;
}

.form-check-label {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.5;
}

.form-check-label a {
    color: #4285f4;
    font-weight: 500;
}

.form-check-label a:hover {
    color: #1a73e8;
}

/* Primary Button */
.btn-primary {
    background: #4285f4;
    border: none;
    border-radius: 8px;
    padding: 0.875rem 1rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #1a73e8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.btn-primary:focus {
    background: #1a73e8;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.2);
}

/* Sign In Link */
.signin-link {
    text-align: center;
    margin-top: 1.5rem;
}

.signin-link p {
    margin: 0;
    color: #666;
    font-size: 0.875rem;
}

.signin-link a {
    color: #4285f4;
    font-weight: 500;
}

.signin-link a:hover {
    color: #1a73e8;
}

/* Multi-Step Form Wizard Styles */

/* Step Progress Indicator */
.step-progress {
    margin-bottom: 1.5rem;
}

.step-progress .progress {
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.step-progress .progress-bar {
    background: linear-gradient(90deg, #4285f4 0%, #1a73e8 100%);
    transition: width 0.3s ease;
}

.step-info {
    font-size: 0.875rem;
}

.step-info #stepTitle {
    font-weight: 500;
    color: #4285f4;
}

/* Form Steps */
.form-step {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.form-step.step-hidden {
    display: none !important;
}

.form-step.step-visible {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.form-step.step-entering {
    opacity: 0;
    transform: translateX(20px);
}

.form-step.step-exiting {
    opacity: 0;
    transform: translateX(-20px);
}

/* Navigation Buttons */
.step-navigation {
    margin-top: 2rem;
}

.step-navigation .btn {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.step-navigation .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.step-navigation .btn-outline-secondary {
    border-color: #dee2e6;
    color: #6c757d;
}

.step-navigation .btn-outline-secondary:hover:not(:disabled) {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.step-navigation .btn-primary {
    background: #4285f4;
    border-color: #4285f4;
}

.step-navigation .btn-primary:hover:not(:disabled) {
    background: #1a73e8;
    border-color: #1a73e8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

/* Step-specific form section styling */
.form-step .form-section {
    margin-bottom: 0;
    padding: 1.5rem;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Mobile responsive adjustments for steps */
@media (max-width: 875px) {
    .step-navigation .btn {
        min-width: 100px;
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .step-progress {
        margin-bottom: 1rem;
    }
    
    .step-info {
        font-size: 0.8rem;
    }
    
    .form-step .form-section {
        padding: 1rem;
        border-radius: 8px;
    }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
    .step-navigation {
        margin-top: 1.5rem;
    }
    
    .step-navigation .d-flex {
        gap: 0.5rem;
    }
    
    .step-navigation .btn {
        flex: 1;
        min-width: auto;
        padding: 0.75rem 0.75rem;
    }
    
    .step-navigation .btn svg {
        width: 14px;
        height: 14px;
    }
}

/* Focus and Accessibility */
.form-control:focus,
.btn:focus,
.form-check-input:focus {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-control {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* Invite Message Styles */
.invite-message-desktop,
.invite-message-mobile {
    margin-bottom: 1.5rem;
}

.invite-message-desktop .invite-text,
.invite-message-mobile .invite-text {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.invite-message-desktop .invite-text p {
    color: white;
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    text-align: center;
}

.invite-message-mobile .invite-text p {
    color: #333;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
}

.invite-message-desktop .invite-text span,
.invite-message-mobile .invite-text span {
    font-weight: 600;
}

/* Show/hide invite messages based on screen size */
.invite-message-desktop {
    display: block;
}

.invite-message-mobile {
    display: none;
}

@media (max-width: 875px) {
    .invite-message-desktop {
        display: none;
    }
    
    .invite-message-mobile {
        display: block;
    }
    
    .invite-message-mobile .invite-text {
        background: #f8f9fa;
        border: 1px solid #e9ecef;
        backdrop-filter: none;
    }
}

/* Print styles */
@media print {
    .left-panel {
        display: none;
    }
    
    .split-screen-container {
        flex-direction: column;
    }
    
    .right-panel {
        min-height: auto;
    }
}

/* Completion State Styles */
.completion-state {
    padding: 2rem 0;
    animation: fadeInUp 0.6s ease-out;
}

.completion-state .success-icon,
.completion-state .error-icon {
    margin-bottom: 1rem;
}

.completion-state .success-icon svg,
.completion-state .error-icon svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.completion-state h2 {
    color: #333;
    font-weight: 600;
    margin-bottom: 1rem;
}

.completion-state .alert {
    border: none;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.completion-state .alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.completion-state .alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.completion-state .alert ul {
    margin-bottom: 0;
    padding-left: 1.2rem;
}

.completion-state #tryAgainBtn {
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
    transition: all 0.3s ease;
}

.completion-state #tryAgainBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(66, 133, 244, 0.4);
}

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

[x-cloak] { display: none !important; }