/* Base styles */
:root {
    --primary-color: #393E46;
    --primary-dark: #222831;
    --primary-light: #e0e7ff;
    --secondary-color: #14b8a6;
    --accent-color: #f97316;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --neutral-50: #f9fafb;
    --neutral-100: #f3f4f6;
    --neutral-200: #e5e7eb;
    --neutral-300: #d1d5db;
    --neutral-400: #9ca3af;
    --neutral-500: #6b7280;
    --neutral-600: #4b5563;
    --neutral-700: #374151;
    --neutral-800: #1f2937;
    --neutral-900: #111827;
    --border-radius: 0.5rem;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s ease-in-out;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--neutral-50);
    color: var(--neutral-700);
    line-height: 1.5;
    min-height: 100vh;
}

/* RTL Support */
body[dir="rtl"] {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 100;
}

.lang-btn {
    background-color: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: var(--neutral-600);
    cursor: pointer;
    transition: var(--transition);
}

.lang-btn:hover {
    background-color: var(--neutral-200);
}

.lang-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-dark);
}

/* Auth Container */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    min-height: 100vh;
}

.auth-card {
    width: 100%;
    max-width: 600px;
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* Step Indicators */
.step-indicators {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem;
    position: relative;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
    z-index: 1;
    background-color: var(--neutral-200);
    color: var(--neutral-500);
    transition: var(--transition);
}

.step-line {
    position: absolute;
    top: 16px;
    left: 50%;
    right: -50%;
    height: 2px;
    background-color: var(--neutral-200);
    z-index: 0;
    transition: var(--transition);
}

.step-indicator:last-child .step-line {
    display: none;
}

.step-label {
    font-size: 0.875rem;
    color: var(--neutral-500);
    margin-top: 4px;
    transition: var(--transition);
}

.step-indicator.active .step-number,
.step-indicator.completed .step-number {
    background-color: var(--primary-color);
    color: white;
}

.step-indicator.active .step-label,
.step-indicator.completed .step-label {
    color: var(--primary-color);
    font-weight: 500;
}

.step-indicator.completed .step-line {
    background-color: var(--primary-color);
}

/* Auth Steps */
.auth-step {
    padding: 0 2rem 2rem;
    animation: fadeIn 0.3s ease-in-out;
}

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

.step-header {
    text-align: center;
    padding-top: 1rem;
    margin-bottom: 1.5rem;
}

.step-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neutral-800);
    margin-bottom: 0.5rem;
}

.step-description {
    color: var(--neutral-600);
}

.highlight-text {
    font-weight: 600;
    color: var(--primary-color);
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--neutral-700);
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--neutral-300);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--neutral-500);
    margin-top: 0.5rem;
}

.form-error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--neutral-100);
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--neutral-500);
}

/* OTP Input */
.otp-input-container {
    position: relative;
}

.otp-input {
    text-align: center;
    font-size: 1.25rem;
    letter-spacing: 0.5em;
}

.clear-input-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--neutral-400);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-input-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

.clear-input-btn:hover {
    color: var(--neutral-600);
}

/* Phone Input */
.phone-input-container {
    display: flex;
}

.country-code-container {
    position: relative;
    width: 25%;
}

.country-flag {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-size: cover;
    z-index: 10;
}

.country-code-select {
    width: 100%;
    padding: 0.75rem;
    padding-left: 40px;
    border: 1px solid var(--neutral-300);
    border-radius: 0.375rem 0 0 0.375rem;
    font-size: 0.875rem;
    background-color: white;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem;
}

.phone-input {
    flex: 1;
    border: 1px solid var(--neutral-300);
    border-left: none;
    border-radius: 0;
    padding: 0.75rem;
    font-size: 0.875rem;
}

.whatsapp-btn {
    width: 15%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 0.375rem 0.375rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.whatsapp-btn:hover {
    background-color: var(--primary-dark);
}

.whatsapp-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Nationality Select */
.nationality-container {
    position: relative;
}

.nationality-select {
    padding-left: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem;
    appearance: none;
}

/* File Upload */
.file-upload-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--neutral-100);
    border: 1px solid var(--neutral-300);
    border-radius: 0.375rem;
    color: var(--neutral-700);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.file-upload-btn:hover {
    background-color: var(--neutral-200);
}

input[type="file"] {
    display: none;
}

.file-name {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--neutral-600);
    display: none;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.submit-btn:hover {
    background-color: var(--primary-dark);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-text {
    display: inline-block;
}

.loading-spinner {
    display: none;
    height: 1.25rem;
    width: 1.25rem;
    margin-left: 0.5rem;
}

.btn-loading .btn-text {
    display: none;
}

.btn-loading .loading-spinner {
    display: inline-block;
}

/* Link Styles */
.link {
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
}

.link:hover {
    color: var(--primary-dark);
}

/* Payment Methods */
.payment-methods {
    margin-bottom: 1.5rem;
}

.payment-method {
    border: 1px solid var(--neutral-300);
    border-radius: var(--border-radius);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 1rem;
}

.payment-method:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.payment-method.active {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.payment-method-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.payment-method-icon {
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}

.payment-method-icon svg {
    height: 1.25rem;
    width: 1.25rem;
    color: var(--primary-color);
}

.payment-method-title {
    font-weight: 500;
    color: var(--neutral-800);
}

.payment-method-details {
    background-color: var(--neutral-50);
    padding: 1rem;
    border-radius: 0.5rem;
}

.payment-instruction {
    text-align: center;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.payment-address {
    background-color: white;
    padding: 0.75rem;
    border-radius: 0.25rem;
    border: 1px solid var(--neutral-200);
    text-align: center;
}

.address-value {
    font-family: monospace;
    font-size: 1.125rem;
}

.address-network {
    font-size: 0.875rem;
    color: var(--neutral-500);
    margin-top: 0.25rem;
}

/* Success Page */
.success-step {
    text-align: center;
    padding: 2rem;
}

.success-icon {
    margin-bottom: 1.5rem;
}

.success-icon svg {
    width: 4rem;
    height: 4rem;
    color: var(--success-color);
    margin: 0 auto;
}

.success-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neutral-800);
    margin-bottom: 1rem;
}

.tracking-info {
    background-color: var(--neutral-50);
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.tracking-label {
    font-size: 0.875rem;
    color: var(--neutral-600);
    margin-bottom: 0.5rem;
}

.tracking-code {
    font-family: monospace;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.success-message {
    color: var(--neutral-600);
    margin-bottom: 1.5rem;
}

.return-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.return-btn:hover {
    background-color: var(--primary-dark);
    color: white;
}

/* Animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .auth-card {
        max-width: 100%;
    }

    .step-label {
        font-size: 0.75rem;
    }

    .step-number {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .step-line {
        top: 12px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .phone-input-container {
        flex-direction: column;
    }

    .country-code-container, 
    .phone-input, 
    .whatsapp-btn {
        width: 100%;
        border-radius: 0.375rem;
        margin-bottom: 0.5rem;
    }

    .country-code-select {
        border-radius: 0.375rem;
    }

    .phone-input {
        border-left: 1px solid var(--neutral-300);
    }

    .file-upload-btn {
        display: block;
        width: 100%;
        text-align: center;
    }
}