/* Modern TAPSIFOOD Auth UI - Redesign with Background Images */

/* Global Styles */
body {
    font-family: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    background-color: #f8f9fa;
}

/* Background Image Container */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/images/back/desktop-app-compressed.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 0.6;
    z-index: 0;
}

@media (max-width: 768px) {
    body::before {
        background-image: url('/images/back/mobile-back-compressed.jpg');
        background-attachment: scroll;
        opacity: 1;
        background-size: cover;
        background-position: center;
    }
}

/* Overlay for better text readability */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.75) 100%);
    z-index: 1;
    pointer-events: none;
}

@media (max-width: 768px) {
    body::after {
        background: transparent; /* No overlay on mobile - background should be clear */
    }
}

/* Main Container */
.auth-container {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .auth-container {
        padding: 0;
        align-items: flex-end;
        min-height: 100vh;
    }
}

/* Form Section - White Card */
.auth-form-section {
    width: 100%;
    max-width: 480px;
    background: white;
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 2;
    animation: fadeInUp 0.6s ease-out;
}

@media (max-width: 768px) {
    .auth-form-section {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        padding: 16px 24px 40px 24px;
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
        margin: 0;
        max-height: 70vh;
        overflow-y: auto;
        animation: slideUpFromBottom 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    /* Handle removed as requested */
}

/* Logo Container */
.logo-container {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

/* TAPSIFOOD Branding */
.logo-text {
    font-size: 28px;
    font-weight: 700;
    color: #FF6B35;
    margin: 0;
    letter-spacing: -0.5px;
}

.logo-line {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #FF6B35 0%, #FF8C5A 100%);
    border-radius: 2px;
    margin: 8px auto 0;
}

/* Form Title */
.form-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 32px;
    text-align: right;
    color: #101828;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .form-title {
        font-size: 22px;
        margin-bottom: 28px;
    }
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
}

/* Labels */
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #344054;
    margin-bottom: 8px;
    text-align: right;
}

.form-label-checkbox {
    font-size: 14px;
    font-weight: 500;
    color: #344054;
    margin: 0;
    line-height: 1.5;
    flex: 1;
}

/* Input Fields */
.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #E4E7EC;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    background: #FFFFFF;
    color: #101828;
    font-family: "Vazirmatn", tahoma, Arial, sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: #FF6B35;
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
}

.form-input::placeholder {
    color: #98A2B3;
}

/* Phone Input Group */
.phone-input-group {
    display: flex;
    gap: 0;
}

.country-code {
    display: none; /* Hidden as requested */
}

.phone-input {
    flex: 1;
}

/* OTP Input Group */
.otp-input-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 8px;
}

.otp-input {
    width: 56px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    border: 1.5px solid #E4E7EC;
    border-radius: 12px;
    transition: all 0.2s ease;
    background: #FFFFFF;
    color: #101828;
}

.otp-input:focus {
    outline: none;
    border-color: #FF6B35;
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
}

@media (max-width: 768px) {
    .otp-input-group {
        gap: 8px;
    }
    
    .otp-input {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* Submit Button - Orange Primary */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C5A 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 24px;
    position: relative;
    overflow: hidden;
    font-family: "Vazirmatn", tahoma, Arial, sans-serif;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.9;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #FF5722 0%, #FF6B35 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3);
}

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

/* Checkbox */
.form-checkbox {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    border: 1.5px solid #E4E7EC !important;
    border-radius: 6px !important;
    cursor: pointer;
    position: relative;
    top: 2px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background-color: #FFFFFF !important;
}

.form-checkbox:checked {
    background-color: #FF6B35 !important;
    border-color: #FF6B35 !important;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3e%3c/svg%3e") !important;
    background-size: 12px 12px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Links */
.create-account-link {
    text-align: center;
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.create-account-link a {
    color: #1E88E5;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.create-account-link a:hover {
    color: #1565C0;
    text-decoration: underline;
}

.create-account-link a.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.create-account-link a svg {
    width: 16px;
    height: 16px;
}

/* Error Messages */
.text-danger {
    color: #DC2626;
    font-size: 13px;
    margin-top: 6px;
    display: block;
}

/* Organization Selection Styles */
.org-selection {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.organization-select-wrapper {
    position: relative;
    width: 100%;
}

.organization-select {
    width: 100%;
    padding: 14px 45px 14px 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    background-color: #FFFFFF;
    text-align: right;
    direction: rtl;
}

.organization-select:focus {
    outline: none;
    border-color: #FF6B35;
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
}

/* Dropdown options styling */
.organization-select option {
    padding: 12px 16px;
    background-color: #FFFFFF;
    color: #101828;
    font-size: 16px;
    border: none;
}

.organization-select option:disabled {
    color: #98A2B3;
    background-color: #F9FAFB;
    font-style: italic;
}

.organization-select option:hover,
.organization-select option:focus {
    background-color: #F9FAFB;
}

.organization-select option:checked {
    background-color: #FFF5F2;
    color: #FF6B35;
    font-weight: 500;
}

.select-arrow {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #98A2B3;
    display: flex;
    align-items: center;
}

.select-arrow svg {
    width: 20px;
    height: 20px;
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #E4E7EC;
    color: #98A2B3;
}

.submit-btn:disabled:hover {
    transform: none;
    box-shadow: none;
    background: #E4E7EC;
}

@media (max-width: 768px) {
    .org-selection {
        padding: 0;
        align-items: flex-end;
    }
}

.org-card {
    background: white;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.05);
    max-width: 500px;
    width: 100%;
    animation: fadeInUp 0.6s ease-out;
}

@media (max-width: 768px) {
    .org-card {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        padding: 16px 24px 40px 24px;
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
        margin: 0;
        max-height: 70vh;
        overflow-y: auto;
        animation: slideUpFromBottom 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    /* Handle removed as requested */
}

.divider-line {
    width: 100%;
    max-width: 320px;
    height: 4px;
    background: linear-gradient(90deg, #FF6B35 0%, #FF8C5A 100%);
    border-radius: 999px;
    margin: 16px auto 24px auto;
}

.organization-list {
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.organization-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 1.5px solid #E4E7EC;
    border-radius: 12px;
    background: #FFFFFF;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.organization-item:hover {
    background-color: #F9FAFB;
    border-color: #FF6B35;
}

.organization-item.active {
    background-color: #FFF5F2;
    border-color: #FF6B35;
}

.organization-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #F9FAFB;
}

.org-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.org-icon {
    color: #98A2B3;
    display: flex;
    align-items: center;
}

.org-name {
    color: #101828;
    font-weight: 500;
    font-size: 15px;
}

.org-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.org-arrow {
    color: #FF6B35;
    display: flex;
    align-items: center;
}

.badge {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.badge-warning {
    background: #FEF3C7;
    color: #B45309;
    border: 1px solid #FDE68A;
}

.badge-muted {
    background: #F3F4F6;
    color: #6B7280;
    border: 1px solid #E5E7EB;
}

.no-organizations {
    text-align: center;
    padding: 40px 20px;
    color: #6B7280;
}

.btn-secondary {
    background-color: #6B7280;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    text-decoration: none;
    display: inline-block;
    margin-top: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: #4B5563;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

/* Register Organization Specific */
.auth-container.register-org .auth-form-section {
    padding: 40px;
}

@media (max-width: 768px) {
    .auth-container.register-org {
        padding: 0;
        align-items: flex-end;
    }
    
    .auth-container.register-org .auth-form-section {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        padding: 16px 24px 40px 24px;
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
        margin: 0;
        max-height: 85vh;
        overflow-y: auto;
        animation: slideUpFromBottom 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    /* Handle removed as requested */
}

/* Done Page */
.done-container {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

@media (max-width: 768px) {
    .done-container {
        padding: 0;
        align-items: flex-end;
    }
}

.message-card {
    background: white;
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.05);
    max-width: 500px;
    width: 100%;
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}

@media (max-width: 768px) {
    .message-card {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        padding: 16px 24px 40px 24px;
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
        margin: 0;
        max-height: 70vh;
        overflow-y: auto;
        animation: slideUpFromBottom 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    /* Handle removed as requested */
}

.message-card h6 {
    font-size: 22px;
    font-weight: 600;
    color: #101828;
    margin: 0 0 16px 0;
}

.message-card p {
    font-size: 15px;
    color: #6B7280;
    line-height: 1.6;
    margin: 0;
}

/* Autocomplete Menu */
.ac-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 1000;
    background: #FFFFFF;
    border: 1.5px solid #E4E7EC;
    border-radius: 12px;
    margin-top: 8px;
    max-height: 220px;
    overflow: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.ac-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #344054;
}

.ac-item:hover,
.ac-item.active {
    background: #F9FAFB;
}

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

@keyframes slideUpFromBottom {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-title {
        font-size: 22px;
        margin-bottom: 16px;
        text-align: right;
    }
    
    .phone-input-group {
        gap: 8px;
    }
    
    .country-code {
        display: none; /* Hidden as requested */
    }
    
    .logo-container {
        margin-bottom: 24px;
        margin-top: 12px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .submit-btn {
        margin-top: 24px;
        padding: 16px;
    }
}

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
}
