/* =====================================================
   auth.css — סגנונות לדפי אימות (RTL, Mobile First)
   ===================================================== */

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

:root {
    --primary:   #1A3C5E;
    --secondary: #2980B9;
    --bg:        #F5F9FD;
    --text:      #333333;
    --border:    #dde3ea;
    --success:   #27ae60;
    --error:     #e74c3c;
    --warn:      #e67e22;
    --radius:    8px;
    --shadow:    0 4px 28px rgba(26,60,94,0.11);
}

html { font-size: 16px; direction: rtl; }

body {
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 16px;
}

/* ── Wrappers ── */
.auth-wrap        { width: 100%; max-width: 480px; }
.auth-wrap--wide  { max-width: 660px; }

.auth-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 44px 40px;
}

/* ── Logo ── */
.auth-logo { text-align: center; margin-bottom: 30px; }

.auth-logo__name {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -1px;
}

.auth-logo__sub {
    font-size: 0.82rem;
    color: #96a0aa;
    margin-top: 3px;
}

.auth-logo__img {
    max-height: 70px;
    max-width: 220px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto 24px;
}

/* ── Title ── */
.auth-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    margin-bottom: 26px;
}

/* ── Alert ── */
.alert {
    padding: 12px 15px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.875rem;
    display: none;
    line-height: 1.5;
}
.alert.show       { display: block; }
.alert--error     { background: #fdf0ef; color: #c0392b; border: 1px solid #f5c6cb; }
.alert--success   { background: #eafaf1; color: #1e8449; border: 1px solid #a9dfbf; }

/* ── Section title ── */
.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.9px;
    margin: 28px 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8edf2;
}
.section-title:first-of-type { margin-top: 0; }

/* ── Form groups ── */
.form-group   { margin-bottom: 16px; }
.form-row     { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4e5a6a;
    margin-bottom: 5px;
}
label .req { color: var(--error); margin-right: 2px; }
label .opt { color: #bbb; font-weight: 400; font-size: 0.76rem; margin-right: 4px; }

/* ── Inputs ── */
.form-control {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.925rem;
    color: var(--text);
    background: #fafcff;
    transition: border-color 0.17s, box-shadow 0.17s;
    font-family: inherit;
    direction: rtl;
}
.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(41,128,185,0.13);
    background: #fff;
}
.form-control.is-invalid { border-color: var(--error); }
.form-control.is-valid   { border-color: var(--success); }

textarea.form-control { resize: vertical; min-height: 90px; line-height: 1.55; }

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7'%3E%3Cpath d='M.5 1l5 5 5-5' stroke='%23888' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 34px;
}

/* ── Field error ── */
.field-error { color: var(--error); font-size: 0.77rem; margin-top: 4px; display: none; }
.field-error.show { display: block; }

/* ── Password show/hide ── */
.pass-wrap { position: relative; }
.pass-wrap .form-control { padding-left: 44px; }
.btn-eye {
    position: absolute;
    left: 11px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    cursor: pointer; color: #b0bec5;
    font-size: 0.75rem; line-height: 1;
    padding: 0;
    transition: color 0.15s;
    font-family: inherit;
    white-space: nowrap;
}
.btn-eye:hover { color: var(--secondary); }

/* ── Char counter ── */
.char-counter { text-align: left; font-size: 0.74rem; color: #b0bec5; margin-top: 3px; }
.char-counter.warn   { color: var(--warn); }
.char-counter.danger { color: var(--error); }

/* ── Tag multiselect (checkboxes as chips) ── */
.tag-group { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-check { display: none; }
.tag-label {
    display: inline-block;
    padding: 6px 14px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.17s;
    user-select: none;
    color: #5a6a7a;
}
.tag-check:checked + .tag-label {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.tag-label:hover { border-color: var(--secondary); color: var(--secondary); }
.tag-check:checked + .tag-label:hover { background: var(--secondary); border-color: var(--secondary); }

/* ── File upload zone ── */
.file-zone {
    border: 2px dashed #c5d3de;
    border-radius: var(--radius);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.17s, background 0.17s;
    background: #fafcff;
}
.file-zone:hover, .file-zone.dragover {
    border-color: var(--secondary);
    background: #eaf4fb;
}
.file-zone__icon  { font-size: 2rem; margin-bottom: 8px; }
.file-zone__title { font-weight: 600; color: var(--primary); margin-bottom: 4px; font-size: 0.95rem; }
.file-zone__hint  { font-size: 0.78rem; color: #9aa8b4; }
.file-zone input[type="file"] { display: none; }

.file-list { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.file-item {
    display: flex; align-items: center; gap: 9px;
    background: #eaf4fb; border-radius: 6px; padding: 8px 12px;
    font-size: 0.82rem;
}
.file-item__icon  { font-size: 1.1rem; flex-shrink: 0; }
.file-item__name  { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--primary); }
.file-item__size  { color: #90a0ae; flex-shrink: 0; font-size: 0.77rem; }
.file-item__del   { background: none; border: none; color: var(--error); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0; flex-shrink: 0; }

/* ── Coupon ── */
.coupon-row         { display: flex; gap: 8px; align-items: flex-start; }
.coupon-row .form-control { flex: 1; }
.btn-coupon {
    padding: 10px 15px;
    background: var(--primary); color: #fff;
    border: none; border-radius: var(--radius);
    font-size: 0.875rem; cursor: pointer;
    white-space: nowrap; transition: background 0.17s; flex-shrink: 0;
}
.btn-coupon:hover    { background: var(--secondary); }
.btn-coupon:disabled { background: #b0bec5; cursor: not-allowed; }

.coupon-msg            { font-size: 0.83rem; margin-top: 6px; display: none; }
.coupon-msg.valid      { color: var(--success); display: block; }
.coupon-msg.invalid    { color: var(--error);   display: block; }

/* ── Buttons ── */
.btn-primary {
    display: block; width: 100%;
    padding: 13px;
    background: var(--primary); color: #fff;
    border: none; border-radius: var(--radius);
    font-size: 1rem; font-weight: 600;
    cursor: pointer; transition: background 0.17s, transform 0.09s;
    font-family: inherit; margin-top: 10px; text-align: center;
}
.btn-primary:hover   { background: var(--secondary); }
.btn-primary:active  { transform: scale(0.985); }
.btn-primary:disabled { background: #a8bfcf; cursor: not-allowed; transform: none; }

/* ── Forgot link ── */
.forgot-link {
    display: inline-block;
    color: var(--secondary); font-size: 0.82rem;
    text-decoration: none; float: left; margin-bottom: 14px;
}
.forgot-link:hover { text-decoration: underline; }
.cf::after { content: ''; display: table; clear: both; }

/* ── Divider ── */
.divider { position: relative; text-align: center; margin: 24px 0; color: #bbb; }
.divider::before { content: ''; position: absolute; top: 50%; right: 0; left: 0; height: 1px; background: #e5eaef; }
.divider span { position: relative; background: #fff; padding: 0 14px; font-size: 0.8rem; }

/* ── Auth links ── */
.auth-links { text-align: center; font-size: 0.875rem; color: #6a7a8a; margin-top: 20px; line-height: 2; }
.auth-links a { color: var(--secondary); text-decoration: none; font-weight: 500; }
.auth-links a:hover { text-decoration: underline; }

/* ── Spinner ── */
.spinner {
    display: inline-block; width: 16px; height: 16px;
    border: 2.5px solid rgba(255,255,255,.4);
    border-top-color: #fff; border-radius: 50%;
    animation: spin .65s linear infinite;
    vertical-align: middle; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Forgot modal ── */
.modal-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.48); z-index: 999;
    align-items: center; justify-content: center;
}
.modal-backdrop.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 12px; padding: 36px 32px;
    max-width: 380px; width: 92%; text-align: center; direction: rtl;
}
.modal-box h3  { color: var(--primary); margin-bottom: 12px; font-size: 1.1rem; }
.modal-box p   { color: #666; font-size: 0.88rem; line-height: 1.65; margin-bottom: 22px; }
.modal-close   {
    padding: 10px 26px; background: var(--primary); color: #fff;
    border: none; border-radius: var(--radius); cursor: pointer;
    font-size: 0.95rem; font-family: inherit;
}
.modal-close:hover { background: var(--secondary); }

/* ── Responsive ── */
@media (max-width: 600px) {
    body { padding: 16px 12px; }
    .auth-card { padding: 28px 18px; }
    .form-row  { grid-template-columns: 1fr; gap: 0; }
    .auth-logo__name { font-size: 1.75rem; }
}
