/* public/css/auth.css */

/* Reset و تنظیمات پایه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/* این کد تقویم را به رویِ همه المان‌ها می‌آورد */
.pdp-default {
    z-index: 999999 !important;
    position: absolute !important;
    display: block; /* برای اطمینان از دیده شدن */
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
    line-height: 1.6;
}

/* کانتینر اصلی */
.registration-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* هدر فرم */
.form-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 40px 0;
}

.form-header h2 {
    color: #1f2937;
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 700;
}

.form-header p {
    color: #6b7280;
    font-size: 16px;
}

/* محتوای فرم */
.form-content {
    padding: 0 40px 40px;
}

/* استایل‌های مشترک فرم‌ها */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.form-group.required label::after {
    content: " *";
    color: #ef4444;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.form-group input:focus {
    outline: none;
    border-color: #4f46e5;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group input.valid {
    border-color: #10b981;
}

.form-group input.invalid {
    border-color: #ef4444;
}

.input-with-prefix {
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #f9fafb;
}

.input-with-prefix:focus-within {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: white;
}

.prefix {
    padding: 12px 16px;
    background: #f3f4f6;
    color: #4b5563;
    border-left: 2px solid #e5e7eb;
    font-weight: 500;
}

.input-with-prefix input {
    flex: 1;
    border: none;
    padding: 12px 16px;
    outline: none;
    background: transparent;
}

.form-hint {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 13px;
}

.validation-message {
    font-size: 13px;
    margin-top: 5px;
    display: none;
}

.validation-message.error {
    display: block;
    color: #ef4444;
}

/* Password wrapper */
.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #4f46e5;
}

/* Password strength */
.password-strength {
    margin-top: 10px;
    display: none;
}

.password-strength.show {
    display: block;
}

.strength-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 5px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 3px;
}

.strength-fill.weak {
    width: 33%;
    background: #ef4444;
}

.strength-fill.medium {
    width: 66%;
    background: #f59e0b;
}

.strength-fill.strong {
    width: 100%;
    background: #10b981;
}

.password-requirements {
    margin-top: 10px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    border-right: 4px solid #e5e7eb;
    font-size: 13px;
    color: #6b7280;
}

.password-requirements ul {
    list-style: none;
    padding-right: 20px;
    margin: 0;
}

.password-requirements li {
    margin-bottom: 5px;
    position: relative;
}

.password-requirements li::before {
    content: "○ ";
    position: absolute;
    right: -20px;
    top: 0;
    color: #9ca3af;
}

.password-requirements li.valid {
    color: #10b981;
}

.password-requirements li.valid::before {
    content: "✓ ";
    color: #10b981;
}

/* Terms */
.terms {
    text-align: center;
    margin: 30px 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}

.terms a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.terms a:hover {
    color: #4338ca;
    text-decoration: underline;
}

/* Buttons */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #4338ca, #6d28d9);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.25);
}

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

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

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

/* Login link */
.login-link {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 15px;
}

.login-link a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
    margin-right: 5px;
    transition: color 0.3s ease;
}

.login-link a:hover {
    color: #4338ca;
    text-decoration: underline;
}

/* SMS Auth Styles */
.auth-step {
    transition: all 0.3s ease;
}

.hidden {
    display: none !important;
}

.code-info {
    text-align: center;
    background: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 2px solid #e5e7eb;
}

.code-info p {
    margin-bottom: 8px;
    color: #374151;
}

.code-info .text-sm {
    font-size: 14px;
    color: #6b7280;
}

.code-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 25px 0;
}

.code-input {
    width: 55px;
    height: 65px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    background: #f9fafb;
    font-family: monospace;
}

.code-input:focus {
    border-color: #4f46e5;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    transform: translateY(-2px);
}

.code-input.filled {
    border-color: #10b981;
    background: #f0fdf4;
}

.timer {
    text-align: center;
    margin: 25px 0;
    color: #4b5563;
    font-size: 18px;
}

#countdown {
    font-family: monospace;
    font-size: 24px;
    font-weight: 700;
    color: #4f46e5;
    background: #f5f3ff;
    padding: 8px 16px;
    border-radius: 8px;
    display: inline-block;
    min-width: 80px;
}

.resend-btn {
    background: none;
    border: none;
    color: #4f46e5;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    padding: 10px 20px;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.resend-btn:hover:not(:disabled) {
    color: #4338ca;
}

.resend-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.resend-btn.hidden {
    display: none;
}

.user-info-form {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e5e7eb;
}

.back-link {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e5e7eb;
}

.back-link button {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.back-link button:hover {
    color: #4f46e5;
}

/* Alerts */
#messageContainer {
    margin: 20px 0;
}

.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin: 15px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideIn 0.3s ease;
    border: 2px solid transparent;
}

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

.alert-success {
    background: #d1fae5;
    border-color: #a7f3d0;
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

/* استایل مودال */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

.modal-body {
    line-height: 1.8;
    color: #4b5563;
}

.modal-footer {
    text-align: left;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e5e7eb;
}

.modal-btn {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.modal-btn:hover {
    background: linear-gradient(135deg, #4338ca, #6d28d9);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.25);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive */
@media (max-width: 768px) {
    .registration-container {
        border-radius: 15px;
    }

    .form-content {
        padding: 0 25px 25px;
    }

    .form-header {
        padding: 25px 25px 0;
    }

    .code-input {
        width: 50px;
        height: 60px;
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .form-content {
        padding: 0 20px 20px;
    }

    .form-header {
        padding: 20px 20px 0;
    }

    .form-header h2 {
        font-size: 24px;
    }

    .code-input {
        width: 45px;
        height: 55px;
        font-size: 20px;
    }

    #countdown {
        font-size: 20px;
    }
}
