/**
 * auth-styles-forms.css - טפסים וכפתורים
 * פוצל מ: auth-styles.css
 * תאריך: 2026-01-20
 *
 * תוכן:
 * - Input Fields + Icons
 * - Password Toggle
 * - Password Strength Meter
 * - Messages (הודעות)
 * - Action Buttons (כל הווריאציות)
 * - Divider
 * - Secondary Actions
 * - Field Validation Styles
 */


/* ==========================================
   Input Fields - עיצוב נקי ופשוט
   ========================================== */
.auth-input-group {
    margin-bottom: 16px;
}

.auth-input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    /* מניעת שינוי גודל בזמן focus */
    box-sizing: border-box;
    isolation: isolate;
}

/* אייקון בתוך השדה - משמאל (מותאם לRTL עברית) */
.auth-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    /* מניעת תזוזה - נעילת מיקום מוחלטת */
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.auth-input-icon svg {
    width: 18px;
    height: 18px;
    /* מניעת שינוי גודל */
    flex-shrink: 0;
    display: block;
}

/* Input פשוט ונקי - מותאם לRTL */
.auth-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    direction: rtl;
    text-align: right;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    color: #1f2937;
    /* מניעת שינוי גודל */
    box-sizing: border-box;
    min-height: 46px;
}

/* שדות סיסמה - padding נוסף בצד ימין עבור כפתור toggle */
.auth-input[type="password"],
input#authPassword.auth-input,
input#authConfirmPassword.auth-input {
    padding-right: 44px;
}

/* שדות באנגלית (מייל) */
.auth-input[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

.auth-input::placeholder {
    color: #6b7280;
}

.auth-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* שינוי צבע אייקון בזמן focus - באמצעות JavaScript */
.auth-input-wrapper:focus-within .auth-input-icon {
    color: #2563eb;
}

/* Floating Label - מוסתר */
.auth-floating-label {
    display: none;
}

/* Input States - רק בשגיאה */
.auth-input-valid {
    border-color: #d1d5db;
}

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

.auth-input-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* שגיאות שדות */
.auth-input-error {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 4px;
    min-height: 0;
}

/* ==========================================
   Password Toggle - כפתור הצגה/הסתרה (בצד ימין לRTL)
   ========================================== */
.auth-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    z-index: 2;
    /* מניעת תזוזה - נעילת מיקום וגודל */
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

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

.auth-password-toggle svg {
    width: 18px;
    height: 18px;
    /* מניעת שינוי גודל */
    flex-shrink: 0;
    display: block;
}

/* ==========================================
   Password Strength Meter
   ========================================== */
.auth-password-strength {
    margin-top: 12px;
}

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

.strength-bar {
    height: 100%;
    width: 100%;
    border-radius: 3px;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease, background 0.4s ease;
}

.strength-text {
    font-size: 0.8rem;
    margin-top: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.strength-tips {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 4px;
}

/* ==========================================
   Messages - הודעות
   ========================================== */
.auth-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--auth-radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    animation: slideDown 0.4s ease;
}

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

.auth-message-error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fecaca;
    color: #dc2626;
}

.auth-message-success {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid #a7f3d0;
    color: #059669;
}

.message-icon {
    font-size: 1.3rem;
}

/* תמיכה לאחור */
.auth-error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: var(--auth-radius-sm);
    font-size: 13px;
    margin-bottom: 15px;
    animation: slideDown 0.3s ease;
}

.auth-success {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid #a7f3d0;
    color: #059669;
    padding: 12px 16px;
    border-radius: var(--auth-radius-sm);
    font-size: 13px;
    margin-bottom: 15px;
    animation: slideDown 0.3s ease;
}

/* ==========================================
   Action Buttons
   ========================================== */
.auth-actions {
    margin-top: 28px;
}

.auth-btn-gradient {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: var(--auth-radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--auth-transition);
    position: relative;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

.auth-btn-primary-modern {
    background: #2563eb;
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.auth-btn-primary-modern:hover:not(:disabled) {
    background: #1d4ed8;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.auth-btn-primary-modern:active:not(:disabled) {
    transform: translateY(-1px);
}

.auth-btn-primary-modern:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Button Loader */
.btn-loader {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==========================================
   Divider - קו הפרדה
   ========================================== */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0;
    color: #6b7280;
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
}

/* ==========================================
   Secondary Actions - כפתורים משניים
   ========================================== */
.auth-secondary-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-btn-outline {
    width: 100%;
    padding: 14px 24px;
    background: transparent;
    border: 2px solid #e5e7eb;
    border-radius: var(--auth-radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    transition: var(--auth-transition);
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

.auth-btn-outline:hover {
    border-color: var(--auth-primary);
    color: var(--auth-primary);
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
}

.auth-btn-link-modern {
    background: none;
    border: none;
    color: var(--auth-primary);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 10px;
    transition: var(--auth-transition);
    font-weight: 600;
}

.auth-btn-link-modern:hover {
    color: var(--auth-secondary);
    text-decoration: underline;
}

.auth-btn-ghost {
    width: 100%;
    padding: 12px 24px;
    background: transparent;
    border: none;
    font-size: 0.9rem;
    color: #6b7280;
    cursor: pointer;
    transition: var(--auth-transition);
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

.auth-btn-ghost:hover {
    color: #6b7280;
}

/* תמיכה לאחור */
.auth-btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--auth-radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--auth-transition);
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

.auth-btn-primary {
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.auth-btn-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

.auth-btn-secondary:hover {
    transform: translateY(-2px);
}

.auth-btn-success {
    background: linear-gradient(135deg, var(--auth-success), #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

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

.auth-btn-danger {
    background: linear-gradient(135deg, var(--auth-danger), #dc2626);
    color: white;
}

.auth-btn-danger:hover {
    transform: translateY(-2px);
}

.auth-btn-link {
    background: none !important;
    color: var(--auth-primary) !important;
    text-decoration: underline;
    padding: 8px !important;
    font-size: 13px;
    border: none;
    cursor: pointer;
    box-shadow: none !important;
}

.auth-btn-link:hover {
    color: var(--auth-secondary) !important;
}

.auth-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.auth-logged-out .auth-buttons {
    flex-direction: column;
}

.auth-logged-out .auth-btn {
    width: 100%;
}

/* ==========================================
   Field Validation Styles
   סגנונות לולידציה של שדות
   ========================================== */

/* שדה עם שגיאה */
input.error,
select.error,
textarea.error {
    border-color: var(--auth-danger) !important;
    background-color: rgba(239, 68, 68, 0.05) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* הודעת שגיאה מתחת לשדה */
.field-error {
    color: var(--auth-danger);
    font-size: 12px;
    margin-top: 4px;
    display: block;
    animation: fadeIn 0.2s ease-out;
}

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

/* שדה תקין (אחרי תיקון שגיאה) */
input.valid,
select.valid,
textarea.valid {
    border-color: var(--auth-success) !important;
    background-color: rgba(16, 185, 129, 0.05) !important;
}

/* Focus על שדה עם שגיאה */
input.error:focus,
select.error:focus,
textarea.error:focus {
    outline: none;
    border-color: var(--auth-danger) !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15) !important;
}
