/**
 * Auth Modal Styles
 * Comprehensive login/signup modal for Ather platform
 * Matches the website's primary theme with #73bdd3 accent color
 */

/* Modal Overlay */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.auth-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* Modal Container */
.auth-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.3s ease;
}

.auth-modal-overlay.active .auth-modal {
    transform: translateY(0) scale(1);
}

/* Modal Header */
.auth-modal-header {
    padding: 24px 24px 0;
    text-align: center;
    position: relative;
}

.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #6b7280;
    font-size: 18px;
    z-index: 10;
}

[dir="rtl"] .auth-modal-close {
    right: auto;
    left: 16px;
}

.auth-modal-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.auth-modal-logo {
    width: 80px;
    height: auto;
    margin-bottom: 12px;
}

.auth-modal-title {
    font-family: "Cairo", sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px;
}

.auth-modal-subtitle {
    font-family: "Cairo", sans-serif;
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Modal Body */
.auth-modal-body {
    padding: 24px;
}

/* Social Login Section */
.auth-social-section {
    margin-bottom: 24px;
}

.auth-google-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: "Cairo", sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-google-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.auth-google-btn:active {
    transform: scale(0.98);
}

.auth-google-btn svg {
    width: 20px;
    height: 20px;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.auth-divider-line {
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.auth-divider-text {
    font-family: "Cairo", sans-serif;
    font-size: 13px;
    color: #9ca3af;
    white-space: nowrap;
}

/* Form Styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-form-label {
    font-family: "Cairo", sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.auth-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-family: "Cairo", sans-serif;
    font-size: 15px;
    color: #1f2937;
    background: #fff;
    transition: all 0.2s ease;
    outline: none;
}

.auth-form-input:focus {
    border-color: #73bdd3;
    box-shadow: 0 0 0 3px rgba(115, 189, 211, 0.15);
}

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

.auth-form-input.error {
    border-color: #ef4444;
}

.auth-form-error {
    font-family: "Cairo", sans-serif;
    font-size: 12px;
    color: #ef4444;
    display: none;
}

.auth-form-error.visible {
    display: block;
}

/* Password Field with Toggle */
.auth-password-wrapper {
    position: relative;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 4px;
    transition: color 0.2s ease;
}

[dir="rtl"] .auth-password-toggle {
    right: auto;
    left: 14px;
}

.auth-password-toggle:hover {
    color: #6b7280;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #73bdd3 0%, #5aa8c0 100%);
    border: none;
    border-radius: 12px;
    font-family: "Cairo", sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.auth-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #5aa8c0 0%, #4a98b0 100%);
    box-shadow: 0 4px 12px rgba(115, 189, 211, 0.35);
}

.auth-submit-btn:active:not(:disabled) {
    transform: scale(0.98);
}

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

.auth-submit-btn .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.8s linear infinite;
}

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

/* Forgot Password Link */
.auth-forgot-link {
    text-align: right;
    margin-top: -8px;
}

[dir="rtl"] .auth-forgot-link {
    text-align: left;
}

.auth-forgot-link a {
    font-family: "Cairo", sans-serif;
    font-size: 13px;
    color: #73bdd3;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-forgot-link a:hover {
    color: #5aa8c0;
    text-decoration: underline;
}

/* Modal Footer */
.auth-modal-footer {
    padding: 0 24px 24px;
    text-align: center;
}

.auth-switch-text {
    font-family: "Cairo", sans-serif;
    font-size: 14px;
    color: #6b7280;
}

.auth-switch-link {
    color: #73bdd3;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-switch-link:hover {
    color: #5aa8c0;
    text-decoration: underline;
}

/* Alert Messages */
.auth-alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-family: "Cairo", sans-serif;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.auth-alert.visible {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-alert.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.auth-alert.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.auth-alert.info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.auth-alert i {
    font-size: 16px;
}

/* View States */
.auth-view {
    display: none;
}

.auth-view.active {
    display: block;
}

/* OTP Input Group */
.auth-otp-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.auth-otp-input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    outline: none;
    transition: all 0.2s ease;
    font-family: "Cairo", sans-serif;
}

.auth-otp-input:focus {
    border-color: #73bdd3;
    box-shadow: 0 0 0 3px rgba(115, 189, 211, 0.15);
}

.auth-otp-input.filled {
    border-color: #73bdd3;
    background: #f0f9fb;
}

/* Resend Code */
.auth-resend {
    text-align: center;
    margin-top: 16px;
}

.auth-resend-text {
    font-family: "Cairo", sans-serif;
    font-size: 13px;
    color: #6b7280;
}

.auth-resend-link {
    color: #73bdd3;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-resend-link:hover {
    color: #5aa8c0;
    text-decoration: underline;
}

.auth-resend-link.disabled {
    color: #9ca3af;
    cursor: not-allowed;
    pointer-events: none;
}

/* Back Button */
.auth-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #6b7280;
    font-family: "Cairo", sans-serif;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.auth-back-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Password Requirements */
.auth-password-requirements {
    margin-top: 8px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.auth-password-requirements h5 {
    font-family: "Cairo", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px;
}

.auth-requirement {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "Cairo", sans-serif;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.auth-requirement:last-child {
    margin-bottom: 0;
}

.auth-requirement i {
    font-size: 12px;
    width: 16px;
}

.auth-requirement.valid {
    color: #059669;
}

.auth-requirement.valid i {
    color: #10b981;
}

.auth-requirement.invalid i {
    color: #d1d5db;
}

/* Name Fields Row */
.auth-name-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Terms Checkbox */
.auth-terms {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 8px;
}

.auth-terms-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: #73bdd3;
}

.auth-terms-label {
    font-family: "Cairo", sans-serif;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.auth-terms-label a {
    color: #73bdd3;
    text-decoration: none;
}

.auth-terms-label a:hover {
    text-decoration: underline;
}

/* Success State */
.auth-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #fff;
    font-size: 36px;
}

.auth-success-title {
    font-family: "Cairo", sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px;
    text-align: center;
}

.auth-success-message {
    font-family: "Cairo", sans-serif;
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    margin: 0 0 20px;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-modal {
        max-width: 100%;
        margin: 10px;
        border-radius: 12px;
    }

    .auth-modal-header,
    .auth-modal-body,
    .auth-modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .auth-name-row {
        grid-template-columns: 1fr;
    }

    .auth-otp-input {
        width: 42px;
        height: 50px;
        font-size: 20px;
    }
}

/* RTL Adjustments */
[dir="rtl"] .auth-modal {
    text-align: right;
}

[dir="rtl"] .auth-back-btn i {
    transform: scaleX(-1);
}
