/* ===========================================================================
   CARD SPLIT AUTH DESIGN - Single Card with Two Panels
   =========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background: #f8fafc;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Main Card Container */
.auth-card {
    width: 100%;
    max-width: 1200px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    min-height: 650px;
}

/* Left Panel - Branding (40% width) */
.brand-panel {
    flex: 0 0 40%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 2.5rem;
    text-align: center;
}

/* Background Pattern */
.brand-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    z-index: 1;
}

/* Brand Content */
.brand-content {
    position: relative;
    z-index: 2;
    color: white;
    width: 100%;
}

/* Logo */
.brand-logo {
    margin-bottom: 2.5rem;
}

.brand-logo img {
    max-width: 180px;
    height: auto;
    filter: brightness(0) invert(1);
}

/* Brand Text */
.brand-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.brand-subtitle {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.9;
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

/* Slider Container */
.slider-container {
    width: 100%;
    margin-bottom: 2rem;
    position: relative;
}

.slider-wrapper {
    position: relative;
    height: 300px;
    overflow: hidden;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.slider-track {
    display: flex;
    transition: transform 0.75s ease-in-out;
    height: 100%;
}

.slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem;
    position: relative;
}

.slide-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}


.slide-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem auto;
    position: relative;
}

.slide-icon {
    width: 80px;
    height: 80px;
    opacity: 0.95;
}

.slide-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: white;
}

.slide-description {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.5;
    max-width: 280px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 auto;
}

/* Minimalist Navigation */
.slider-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    position: relative;
    z-index: 3;
}

.nav-dot {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.4s ease;
    border: none;
    outline: none;
    position: relative;
}

.nav-dot.active {
    background: white;
    width: 50px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.nav-dot:hover:not(.active) {
    background: rgba(255, 255, 255, 0.6);
    width: 45px;
}

/* Alternative: Simple Card Style */
.feature-cards {
    display: none;
    /* We'll use this as an alternative approach if needed */
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.feature-card-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-card-icon svg {
    width: 28px;
    height: 28px;
}

.feature-card-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.feature-card-content p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    margin: 0;
}

/* Right Panel - Form (60% width) */
.form-panel {
    flex: 0 0 60%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
}

/* Form Container */
.form-container {
    width: 100%;
    max-width: 500px;
}

/* Form Header */
.form-header {
    margin-bottom: 2rem;
    text-align: center;
}

.form-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.form-subtitle {
    font-size: 0.95rem;
    color: #6b7280;
    font-weight: 400;
    line-height: 1.5;
}

/* Form Styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Two Column Form Layout for Registration */
.auth-form.register-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.5rem;
}

.auth-form.register-form .form-group.full-width,
.auth-form.register-form .alert.full-width,
.auth-form.register-form .alert {
    grid-column: 1 / -1;
}

.auth-form.register-form .form-actions,
.auth-form.register-form .submit-button,
.auth-form.register-form .form-footer {
    grid-column: 1 / -1;
}

.form-group {
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* Input Fields */
.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    padding-left: 2.75rem;
    font-size: 1rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    transition: all 0.2s ease;
    font-family: inherit;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px var(--primary-light, rgba(59, 130, 246, 0.1));
}

.form-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* Input Icons */
.input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.125rem;
    pointer-events: none;
    z-index: 1;
}

.input-wrapper:focus-within .input-icon {
    color: var(--primary-color, #3b82f6);
}

/* Password Toggle */
.password-wrapper .form-input {
    padding-right: 2.75rem;
}

.password-toggle {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.125rem;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    z-index: 2;
}

.password-toggle:hover {
    color: #6b7280;
    background: rgba(107, 114, 128, 0.1);
}

/* Form Actions Row */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.5rem 0 1.5rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-checkbox {
    width: 1rem;
    height: 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.form-checkbox:checked {
    background: var(--primary-color, #3b82f6);
    border-color: var(--primary-color, #3b82f6);
}

.form-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}

.checkbox-label {
    font-size: 0.875rem;
    color: #6b7280;
    cursor: pointer;
    user-select: none;
    font-weight: 400;
}

/* Forgot Password Link */
.forgot-link {
    color: var(--primary-color, #3b82f6);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: var(--primary-dark, #1d4ed8);
}

/* Submit Button */
.submit-button {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--primary-color, #3b82f6);
    color: white;
    margin-bottom: 1.5rem;
}

.submit-button:hover {
    background: var(--primary-dark, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-light, rgba(59, 130, 246, 0.3));
}

.submit-button:active {
    transform: translateY(0);
}

/* Form Footer */
.form-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #f3f4f6;
}

.footer-text {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 400;
}

.footer-link {
    color: var(--primary-color, #3b82f6);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--primary-dark, #1d4ed8);
}

/* Alert Messages */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

/* Error States */
.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-message {
    font-size: 0.8rem;
    color: #ef4444;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

/* Theme Colors */
.tenant-theme {
    --primary-color: #127db5;
    --primary-dark: #0e608b;
    --primary-light: rgba(18, 125, 181, 0.1);
}

.tenant-theme .brand-panel {
    background: linear-gradient(135deg, #127db5 0%, #2bb8ff 100%);
}

.owner-theme {
    --primary-color: #0b2c5b;
    --primary-dark: #071f41;
    --primary-light: rgba(11, 44, 91, 0.1);
}

.owner-theme .brand-panel {
    background: linear-gradient(135deg, #0b2c5b 0%, #1a4a8c 100%);
}

/* Responsive Design */
@media (max-width: 1024px) {
    body {
        padding: 1rem;
    }

    .auth-card {
        flex-direction: column;
        max-width: 600px;
        min-height: auto;
    }

    .brand-panel {
        flex: none;
        padding: 2.5rem 2rem;
    }

    .brand-title {
        font-size: 1.75rem;
    }

    .feature-list {
        display: none;
    }

    .form-panel {
        flex: none;
        padding: 2.5rem 2rem;
    }
}

@media (max-width: 640px) {
    body {
        padding: 0.5rem;
    }

    .auth-card {
        border-radius: 16px;
        max-width: 100%;
    }

    .brand-panel {
        padding: 2rem 1.5rem;
    }

    .brand-title {
        font-size: 1.5rem;
    }

    .brand-subtitle {
        font-size: 0.9rem;
        margin-bottom: 2rem;
    }

    .form-panel {
        padding: 2rem 1.5rem;
    }

    .form-title {
        font-size: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .checkbox-wrapper {
        justify-content: center;
    }

    .forgot-link {
        text-align: center;
    }
}

/* Loading State */
.loading {
    position: relative;
    color: transparent;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Phone Number Field Styles */
.phone-wrapper {
    display: flex;
    align-items: stretch;
    position: relative;
}

.country-code-selector {
    position: relative;
    flex-shrink: 0;
    border-right: 1px solid #e5e7eb;
}

.selected-country {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 0.75rem;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-right: none;
    border-radius: 10px 0 0 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.selected-country:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

/* Standalone Country Selector Modifiers */
.standalone-selector .selected-country {
    border-radius: 10px;
    border-right: 1.5px solid #e5e7eb;
    width: 100%;
}

.standalone-selector .selected-country .flag {
    margin-left: 1.5rem;
}

.standalone-selector .selected-country .name-display {
    flex: 1;
    font-size: 0.95rem;
    color: #374151;
}

.standalone-selector .country-dropdown {
    width: 100%;
}

.selected-country .flag {
    font-size: 1.125rem;
}

.selected-country .code {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.dropdown-icon {
    font-size: 1rem;
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.country-code-selector.open .dropdown-icon {
    transform: rotate(180deg);
}

.country-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 350px;
    /* Big width as requested */
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 400px;
    /* More height for all countries */
    overflow: hidden;
    display: none;
    margin-top: 5px;
}

.country-code-selector.open .country-dropdown {
    display: block;
}

.dropdown-search {
    position: relative;
    padding: 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    padding-left: 2rem;
    font-size: 0.875rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    border-color: var(--primary-color, #3b82f6);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.875rem;
}

.country-list {
    max-height: 330px;
    overflow-y: auto;
}

/* Custom scrollbar for country list */
.country-list::-webkit-scrollbar {
    width: 6px;
}

.country-list::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.country-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.country-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.country-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.country-option:hover {
    background: #f9fafb;
}

.country-option.selected {
    background: var(--primary-light, rgba(59, 130, 246, 0.1));
    color: var(--primary-color, #3b82f6);
}

.country-option .flag-img {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.selected-country .flag-img {
    width: 22px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
}

.country-option .name {
    font-size: 0.875rem;
    flex: 1;
    font-weight: 400;
}

.country-option .code {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

.phone-input {
    border-left: none !important;
    border-radius: 0 10px 10px 0 !important;
    padding-left: 1rem !important;
}

.phone-wrapper:focus-within .selected-country {
    border-color: var(--primary-color, #3b82f6);
    background: white;
}

.phone-wrapper:focus-within .phone-input {
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px var(--primary-light, rgba(59, 130, 246, 0.1));
}

/* Select Dropdown Styles */
.dropdown-wrapper {
    position: relative;
}

.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    padding-left: 2.75rem;
    padding-right: 2.75rem;
    font-size: 1rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    transition: all 0.2s ease;
    font-family: inherit;
    outline: none;
    appearance: none;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px var(--primary-light, rgba(59, 130, 246, 0.1));
}

.form-select option {
    padding: 0.5rem;
    font-size: 1rem;
}

.dropdown-arrow {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1rem;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.dropdown-wrapper:focus-within .dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
    color: var(--primary-color, #3b82f6);
}

.dropdown-wrapper:focus-within .input-icon {
    color: var(--primary-color, #3b82f6);
}

/* City Input with Suggestions */
.city-wrapper {
    position: relative;
}

.city-input {
    width: 100%;
}

/* Custom Datalist Styling */
.city-input::-webkit-calendar-picker-indicator {
    display: none;
}

/* Error States for New Fields */
.form-select.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.phone-wrapper .form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.phone-wrapper .form-input.error+.selected-country {
    border-color: #ef4444;
}

/* Responsive Adjustments for Registration Forms */
@media (max-width: 768px) {
    .auth-form.register-form {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .auth-form.register-form .form-group.full-width {
        grid-column: 1;
    }
}

/* Responsive Adjustments for New Fields */
@media (max-width: 640px) {
    .phone-wrapper {
        flex-direction: column;
    }

    .selected-country {
        border-radius: 10px 10px 0 0;
        border-right: 1.5px solid #e5e7eb;
        border-bottom: none;
        justify-content: center;
        min-width: auto;
    }

    .phone-input {
        border-radius: 0 0 10px 10px !important;
        border-left: 1.5px solid #e5e7eb !important;
        border-top: none !important;
    }

    .country-dropdown {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90vw;
        max-width: 320px;
        max-height: 60vh;
    }
}

/* Accessibility */
.form-input:focus,
.form-select:focus,
.form-checkbox:focus,
.submit-button:focus,
.forgot-link:focus,
.footer-link:focus {
    outline: 2px solid var(--primary-color, #3b82f6);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}