/* Turkhosting WHMCS Auth Forms - Custom Styles */

/* Form Section Styles */
.form-section {
    margin-bottom: 1.75rem;
}

.form-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6B7280;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-title svg {
    width: 1rem;
    height: 1rem;
    color: #9CA3AF;
}

/* Form Label */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* Form Input */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: 0.625rem;
    color: #111827;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    outline: none;
}

.form-input::placeholder {
    color: #9CA3AF;
}

.form-input:hover {
    border-color: #D1D5DB;
}

.form-input:focus {
    border-color: #DC2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Select Dropdown */
select.form-input {
    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;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

/* Form Error */
.form-error {
    font-size: 0.75rem;
    color: #DC2626;
    margin-top: 0.375rem;
}

/* Form Input Error State */
.form-input.error {
    border-color: #DC2626;
    background: #FEF2F2;
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* Form Input Success State */
.form-input.success {
    border-color: #10B981;
    background: #F0FDF4;
}

/* Checkbox Styling */
.form-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.125rem;
    accent-color: #DC2626;
    border: 1px solid #D1D5DB;
    border-radius: 0.25rem;
    cursor: pointer;
    flex-shrink: 0;
}

.form-checkbox:checked {
    background-color: #DC2626;
    border-color: #DC2626;
}

/* Password Strength Colors */
.strength-weak {
    background-color: #EF4444 !important;
}

.strength-fair {
    background-color: #F59E0B !important;
}

.strength-good {
    background-color: #10B981 !important;
}

.strength-strong {
    background-color: #059669 !important;
}

/* Button Loading State */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Shake Animation for Errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* Success Card */
.success-card {
    background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
    border: 1px solid #86EFAC;
}

/* Phone Input Group Fix */
.phone-input-group {
    display: flex;
    position: relative;
}

.phone-input-group > div:first-child button,
.phone-input-group > div:first-child button.form-input {
    border-right: none !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    margin-right: -1px;
    position: relative;
    z-index: 1;
}

.phone-input-group input,
.phone-input-group input.form-input,
.phone-input-group > input,
.phone-input-group input.flex-1 {
    border-left: 1px solid #E5E7EB !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.phone-input-group input:focus {
    z-index: 20;
    border-left-color: #DC2626 !important;
}

/* Phone Dropdown Styles */
.phone-dropdown {
    scrollbar-width: thin;
    scrollbar-color: #D1D5DB #F3F4F6;
}

.phone-dropdown::-webkit-scrollbar {
    width: 6px;
}

.phone-dropdown::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 3px;
}

.phone-dropdown::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

.phone-dropdown::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Force form group to allow dropdown overflow */
.form-group {
    position: relative;
    overflow: visible !important;
}

/* Ensure steps container allows overflow */
.step-content {
    overflow: visible !important;
}

/* Form container scrolls internally, dropdowns use z-index */
.form-container-scroll {
    overflow-y: auto;
}

/* Steps Container */
.steps-container {
    position: relative;
    overflow: visible;
}

.steps-container.animating {
    overflow: hidden;
}

/* Step Content */
.step-content {
    display: none;
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Step Indicator */
.step-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F4F6;
    border: 2px solid #E5E7EB;
    transition: all 0.3s ease;
}

.step-indicator .step-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: #9CA3AF;
    transition: all 0.3s ease;
}

.step-indicator.active {
    background: #DC2626;
    border-color: #DC2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}

.step-indicator.active .step-number {
    color: #ffffff;
}

.step-indicator.completed {
    background: #10B981;
    border-color: #10B981;
}

.step-indicator.completed .step-number {
    color: #ffffff;
}

/* Progress Fill */
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10B981, #059669);
    border-radius: 9999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.filled {
    width: 100%;
}

/* Step Navigation Buttons */
.step-btn-next,
.step-btn-prev,
.step-btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.step-btn-next {
    background: #DC2626;
    color: #ffffff;
    border: none;
}

.step-btn-next:hover {
    background: #B91C1C;
    transform: translateX(2px);
}

.step-btn-prev {
    background: #ffffff;
    color: #6B7280;
    border: 1px solid #E5E7EB;
}

.step-btn-prev:hover {
    background: #F9FAFB;
    color: #374151;
    transform: translateX(-2px);
}

.step-btn-submit {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.step-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.step-btn-submit:disabled {
    background: #9CA3AF;
    box-shadow: none;
    transform: none;
}

/* Language Dropdown */
#lang-dropdown {
    scrollbar-width: thin;
    scrollbar-color: #D1D5DB #F3F4F6;
}

#lang-dropdown::-webkit-scrollbar {
    width: 6px;
}

#lang-dropdown::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 3px;
}

#lang-dropdown::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

#lang-dropdown::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Primary color utilities */
.bg-primary {
    background-color: #DC2626;
}

.bg-primary-hover:hover {
    background-color: #B91C1C;
}

.text-primary {
    color: #DC2626;
}

.text-primary-hover:hover {
    color: #B91C1C;
}

.border-primary {
    border-color: #DC2626;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    body {
        background-color: #ffffff;
    }
}

@media (max-width: 640px) {
    .form-input {
        padding: 0.875rem 1rem;
        font-size: 1rem; /* Prevent zoom on iOS */
    }

    .step-indicator {
        width: 28px;
        height: 28px;
    }

    .step-indicator .step-number {
        font-size: 0.75rem;
    }

    [id^="step-label-"] {
        display: none;
    }

    .step-btn-next,
    .step-btn-prev,
    .step-btn-submit {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

/* ========================================
   RTL SUPPORT (Arabic)
   ======================================== */

/* RTL - Main Page Layout (form left, panel right → panel left, form right) */
[dir="rtl"] .main-layout {
    flex-direction: row-reverse !important;
}

[dir="rtl"] .main-layout > div:first-child {
    order: 2;
}

[dir="rtl"] .main-layout > div:last-child {
    order: 1;
}

/* RTL - All text should be right-aligned */
[dir="rtl"] body {
    text-align: right;
}

/* RTL - Form Labels */
[dir="rtl"] .form-label {
    text-align: right;
}

/* RTL - Form Inputs */
[dir="rtl"] .form-input {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .form-input::placeholder {
    text-align: right;
}

/* RTL - Select Dropdown Arrow */
[dir="rtl"] select.form-input {
    background-position: left 0.75rem center !important;
    padding-left: 2.5rem !important;
    padding-right: 1rem !important;
}

/* RTL - Phone Input Group */
[dir="rtl"] .phone-input-group {
    flex-direction: row-reverse !important;
}

[dir="rtl"] .phone-input-group > div:first-child button {
    border-right: 1px solid #E5E7EB !important;
    border-left: none !important;
    margin-right: 0 !important;
    margin-left: -1px !important;
    border-radius: 0 0.625rem 0.625rem 0 !important;
}

[dir="rtl"] .phone-input-group input {
    border-left: none !important;
    border-right: 1px solid #E5E7EB !important;
    border-radius: 0.625rem 0 0 0.625rem !important;
}

[dir="rtl"] .phone-dropdown {
    left: auto !important;
    right: 0 !important;
}

[dir="rtl"] .phone-dropdown button {
    flex-direction: row-reverse !important;
    text-align: right !important;
}

/* RTL - Form Section Titles */
[dir="rtl"] .form-section-title {
    flex-direction: row-reverse !important;
}

/* RTL - Header */
[dir="rtl"] header {
    flex-direction: row-reverse !important;
}

/* RTL - Flex containers with justify-between */
[dir="rtl"] .flex.justify-between {
    flex-direction: row-reverse !important;
}

/* RTL - Checkboxes and Labels */
[dir="rtl"] label.flex.items-start.gap-3,
[dir="rtl"] label.flex.items-center.gap-3 {
    flex-direction: row-reverse !important;
}

[dir="rtl"] .form-checkbox {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* RTL - Error Messages */
[dir="rtl"] .form-error {
    text-align: right;
}

[dir="rtl"] .form-error.ml-7 {
    margin-left: 0 !important;
    margin-right: 1.75rem !important;
}

/* RTL - Step Navigation */
[dir="rtl"] .step-btn-next,
[dir="rtl"] .step-btn-prev {
    flex-direction: row-reverse !important;
}

[dir="rtl"] .step-btn-next svg,
[dir="rtl"] .step-btn-prev svg {
    transform: scaleX(-1) !important;
}

[dir="rtl"] .step-btn-next:hover {
    transform: translateX(-2px) !important;
}

[dir="rtl"] .step-btn-prev:hover {
    transform: translateX(2px) !important;
}

/* RTL - Step Indicators Row */
[dir="rtl"] .flex.items-center.justify-center.mb-8 {
    flex-direction: row-reverse !important;
}

/* RTL - Account Type Toggle */
[dir="rtl"] .inline-flex.rounded-xl.bg-gray-100 {
    flex-direction: row-reverse !important;
}

/* RTL - Country Type Toggle */
[dir="rtl"] .grid.grid-cols-2.gap-2 {
    direction: rtl !important;
}

/* RTL - Password Field Eye Button */
[dir="rtl"] .relative input.form-input + button,
[dir="rtl"] .relative button.absolute {
    right: auto !important;
    left: 0.75rem !important;
}

[dir="rtl"] input[class*="pr-12"] {
    padding-right: 1rem !important;
    padding-left: 3rem !important;
}

/* RTL - Password Strength Indicator */
[dir="rtl"] .flex.gap-1.mb-1 {
    flex-direction: row-reverse !important;
}

/* RTL - Generate Password Button */
[dir="rtl"] button.flex.items-center.gap-1 {
    flex-direction: row-reverse !important;
}

/* RTL - Language Dropdown */
[dir="rtl"] #lang-dropdown {
    left: 0 !important;
    right: auto !important;
}

[dir="rtl"] #lang-dropdown button {
    flex-direction: row-reverse !important;
    text-align: right !important;
}

/* RTL - Language Selector Button */
[dir="rtl"] .relative button[type="button"].flex.items-center.gap-2 {
    flex-direction: row-reverse !important;
}

/* RTL - Grid Layouts */
[dir="rtl"] .grid.grid-cols-2 {
    direction: rtl !important;
}

/* RTL - Right Panel Text */
[dir="rtl"] .hidden.lg\:flex.w-2\/5 {
    text-align: right !important;
}

[dir="rtl"] .hidden.lg\:flex.w-2\/5 .text-center {
    text-align: center !important;
}

/* RTL - Success Message */
[dir="rtl"] .fade-in a.inline-flex {
    flex-direction: row-reverse !important;
}

/* RTL - Login Page Link */
[dir="rtl"] p.text-center a.ml-1 {
    margin-left: 0 !important;
    margin-right: 0.25rem !important;
}

/* RTL - Margins Swap */
[dir="rtl"] .ml-1 { margin-left: 0 !important; margin-right: 0.25rem !important; }
[dir="rtl"] .ml-2 { margin-left: 0 !important; margin-right: 0.5rem !important; }
[dir="rtl"] .ml-3 { margin-left: 0 !important; margin-right: 0.75rem !important; }
[dir="rtl"] .ml-4 { margin-left: 0 !important; margin-right: 1rem !important; }
[dir="rtl"] .ml-6 { margin-left: 0 !important; margin-right: 1.5rem !important; }
[dir="rtl"] .ml-7 { margin-left: 0 !important; margin-right: 1.75rem !important; }
[dir="rtl"] .ml-auto { margin-left: 0 !important; margin-right: auto !important; }
[dir="rtl"] .mr-1 { margin-right: 0 !important; margin-left: 0.25rem !important; }
[dir="rtl"] .mr-2 { margin-right: 0 !important; margin-left: 0.5rem !important; }
[dir="rtl"] .mr-3 { margin-right: 0 !important; margin-left: 0.75rem !important; }
[dir="rtl"] .mr-4 { margin-right: 0 !important; margin-left: 1rem !important; }

/* RTL - Paddings Swap */
[dir="rtl"] .pl-4 { padding-left: 0 !important; padding-right: 1rem !important; }
[dir="rtl"] .pr-4 { padding-right: 0 !important; padding-left: 1rem !important; }
[dir="rtl"] .pl-6 { padding-left: 0 !important; padding-right: 1.5rem !important; }
[dir="rtl"] .pr-6 { padding-right: 0 !important; padding-left: 1.5rem !important; }

/* RTL - Border Radius Swap */
[dir="rtl"] .rounded-l-xl {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: 0.75rem !important;
    border-bottom-right-radius: 0.75rem !important;
}
[dir="rtl"] .rounded-r-xl {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 0.75rem !important;
    border-bottom-left-radius: 0.75rem !important;
}

/* RTL - Icons should flip horizontally */
[dir="rtl"] svg[class*="rotate-180"] {
    transform: rotate(-180deg) !important;
}

/* RTL - Border adjustments */
[dir="rtl"] .border-l { border-left: none !important; border-right: 1px solid !important; }
[dir="rtl"] .border-r { border-right: none !important; border-left: 1px solid !important; }

/* RTL - Step Content Animation */
[dir="rtl"] .step-content {
    transform: translateX(-30px);
}

[dir="rtl"] .step-content.active {
    transform: translateX(0);
}

/* RTL - Progress bar direction */
[dir="rtl"] .progress-fill {
    transform-origin: right !important;
}
