/* ═══════════════════════════════════════════════
   auth.css — shared styles for all auth pages
   اتونیاز | RTL | EstedadV2
═══════════════════════════════════════════════ */

/* ── Base reset ── */
html, body { height: 100%; margin: 0; padding: 0; }
body { background: #f0f4f8 !important; font-family: EstedadV2, sans-serif !important; }
.main { all: unset !important; display: block !important; min-height: 100vh !important; }

/* ── Iconsax helpers ── */
.isax { fill: currentColor; display: inline-block; vertical-align: middle; flex-shrink: 0; }
.isax-14 { width:14px; height:14px; }
.isax-16 { width:16px; height:16px; }
.isax-18 { width:18px; height:18px; }
.isax-20 { width:20px; height:20px; }
.isax-24 { width:24px; height:24px; }
.isax-28 { width:28px; height:28px; }
.isax-32 { width:32px; height:32px; }

/* ════════════════════════════════════
   PAGE WRAPPER
════════════════════════════════════ */
.ap-page {
    display: flex;
    min-height: 100vh;
}

/* ════════════════════════════════════
   LEFT PANEL — branding
════════════════════════════════════ */
.ap-left {
    width: 400px;
    flex-shrink: 0;
    background: linear-gradient(160deg, #003d70 0%, #0069BC 55%, #0cc0cf 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 52px 44px;
    position: relative;
    overflow: hidden;
}
/* Role color variants */
.ap-left.ap-left--expert   { background: linear-gradient(160deg, #064e3b 0%, #059669 55%, #34d399 100%); }
.ap-left.ap-left--marketer { background: linear-gradient(160deg, #78350f 0%, #d97706 55%, #fbbf24 100%); }
.ap-left.ap-left--shopper  { background: linear-gradient(160deg, #134e4a 0%, #0d9488 55%, #2dd4bf 100%); }

.ap-left::before {
    content: ''; position: absolute; top: -120px; left: -100px;
    width: 380px; height: 380px;
    background: rgba(255,255,255,0.06); border-radius: 50%; pointer-events: none;
}
.ap-left::after {
    content: ''; position: absolute; bottom: -80px; right: -80px;
    width: 280px; height: 280px;
    background: rgba(255,255,255,0.04); border-radius: 50%; pointer-events: none;
}

.ap-left-top { position: relative; z-index: 1; }
.ap-left-logo { margin-bottom: 44px; }
.ap-left-logo img { height: 50px; filter: brightness(0) invert(1); }

.ap-left-badge {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(255,255,255,0.15);
    border-radius: 50px; padding: 6px 14px;
    margin-bottom: 20px; font-size: 13px;
    color: rgba(255,255,255,0.9);
}
.ap-left-title {
    font-size: 1.75rem; font-weight: 900;
    color: #fff; line-height: 1.45; margin: 0 0 12px;
}
.ap-left-title span { color: rgba(255,255,255,0.55); }
.ap-left-desc {
    font-size: 13.5px; color: rgba(255,255,255,0.65);
    line-height: 1.9; margin: 0;
}

.ap-left-feats { display: flex; flex-direction: column; gap: 14px; position: relative; z-index: 1; }
.ap-left-feat { display: flex; align-items: center; gap: 12px; }
.ap-left-feat-icon {
    width: 38px; height: 38px; border-radius: 11px;
    background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.9); flex-shrink: 0;
}
.ap-left-feat span { font-size: 13px; color: rgba(255,255,255,0.72); }

/* ════════════════════════════════════
   RIGHT PANEL — form area
════════════════════════════════════ */
.ap-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: #f5f7fa;
    overflow-y: auto;
    min-height: 100vh;
}

/* ════════════════════════════════════
   CARD — form container
════════════════════════════════════ */
.ap-card { width: 100%; max-width: 480px; }

.ap-card-logo { margin-bottom: 20px; text-align: center; }
.ap-card-logo img { height: 44px; }

/* Role badge inside card */
.ap-card-role {
    display: inline-flex; align-items: center; gap: 6px;
    border-radius: 50px; padding: 5px 12px;
    font-size: 12px; font-weight: 700; margin-bottom: 16px;
}
.ap-card-role.--customer { background: rgba(0,105,188,0.08); color: #0069BC; }
.ap-card-role.--expert   { background: rgba(5,150,105,0.08); color: #059669; }
.ap-card-role.--marketer { background: rgba(217,119,6,0.08);  color: #d97706; }
.ap-card-role.--shopper  { background: rgba(13,148,136,0.08); color: #0d9488; }

/* Back button */
.ap-back {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: #8a96a3; text-decoration: none;
    margin-bottom: 18px; transition: color 0.2s;
}
.ap-back:hover { color: #0069BC; text-decoration: none; }

/* Titles */
.ap-card-title {
    font-size: 1.3rem; font-weight: 900;
    color: #111; margin: 0 0 5px;
}
.ap-card-sub { font-size: 13px; color: #8a96a3; margin: 0 0 24px; }

/* ════════════════════════════════════
   FORM INPUTS
════════════════════════════════════ */
.ap-label,
.ap-card label {
    display: block; font-size: 13px; font-weight: 600;
    color: #374151; margin-bottom: 6px;
}
.ap-field { margin-bottom: 18px; }
.ap-hint { font-size: 11.5px; color: #a0aab4; margin-top: 5px; display: block; }

/* Override input-custom-auth from old CSS */
.input-custom-auth,
.ap-input {
    width: 100% !important;
    height: 50px !important;
    padding: 0 16px !important;
    font-size: 14px !important;
    font-family: EstedadV2, sans-serif !important;
    color: #111 !important;
    background: #fff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 14px !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
    display: block !important;
}
.input-custom-auth:focus,
.ap-input:focus {
    border-color: #0069BC !important;
    box-shadow: 0 0 0 3px rgba(0,105,188,0.1) !important;
}
.input-custom-auth.is-valid,
.ap-input.is-valid  { border-color: #10b981 !important; background: #f0fdf4 !important; }
.input-custom-auth.is-invalid,
.ap-input.is-invalid { border-color: #ef4444 !important; background: #fff5f5 !important; }
.input-custom-auth.is-valid:focus  { box-shadow: 0 0 0 3px rgba(16,185,129,0.1) !important; }
.input-custom-auth.is-invalid:focus{ box-shadow: 0 0 0 3px rgba(239,68,68,0.1) !important; }

/* Bootstrap validation overrides */
.was-validated .input-custom-auth:valid,
.input-custom-auth.is-valid { background-image: none !important; }
.was-validated .input-custom-auth:invalid,
.input-custom-auth.is-invalid { background-image: none !important; }
.invalid-feedback { font-size: 12px; color: #ef4444; margin-top: 5px; display: block; }
.valid-feedback   { font-size: 12px; color: #10b981; margin-top: 5px; }
small.text-muted  { font-size: 11.5px; color: #a0aab4 !important; display: block; margin-top: 5px; }

/* ════════════════════════════════════
   BUTTONS
════════════════════════════════════ */
/* Primary button — overrides Bootstrap .btn.btn-secondary */
.ap-page .btn-secondary,
.ap-page .btn.btn-secondary,
.ap-btn {
    display: flex !important;
    align-items: center !important; justify-content: center !important;
    gap: 8px; width: 100%; height: 52px;
    padding: 0 24px !important;
    background: #0069BC !important; color: #fff !important;
    border: none !important; border-radius: 16px !important;
    font-size: 15px !important; font-weight: 700 !important;
    font-family: EstedadV2, sans-serif !important;
    cursor: pointer; text-decoration: none;
    transition: background 0.2s, transform 0.15s, opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
    box-shadow: none !important;
}
.ap-page .btn-secondary:hover,
.ap-page .btn.btn-secondary:hover,
.ap-btn:hover { background: #0058a0 !important; color: #fff !important; text-decoration: none; transform: translateY(-1px); }
.ap-page .btn-secondary:active,
.ap-btn:active { transform: scale(0.98) !important; }
.ap-page .btn-secondary:disabled,
.ap-page .btn-secondary[disabled],
.ap-btn:disabled {
    opacity: 0.5 !important; cursor: not-allowed !important; transform: none !important;
    background: #0069BC !important;
}

/* Outline / secondary button (OTP page: ورود از طریق رمز عبور) */
.ap-page .btn-primary,
.ap-page .btn.btn-primary,
.ap-btn-outline {
    display: flex !important;
    align-items: center !important; justify-content: center !important;
    gap: 8px; width: 100%; height: 50px;
    padding: 0 24px !important;
    background: transparent !important; color: #0069BC !important;
    border: 1.5px solid #0069BC !important; border-radius: 16px !important;
    font-size: 14.5px !important; font-weight: 600 !important;
    font-family: EstedadV2, sans-serif !important;
    cursor: pointer; text-decoration: none;
    transition: background 0.2s, color 0.2s;
    box-shadow: none !important;
}
.ap-page .btn-primary:hover,
.ap-btn-outline:hover { background: rgba(0,105,188,0.06) !important; color: #0069BC !important; text-decoration: none; }

/* Remove bx icon display from buttons */
.ap-page button i.bx,
.ap-page a i.bx { display: none !important; }

/* ════════════════════════════════════
   DIVIDER
════════════════════════════════════ */
.ap-divider,
.ap-page .row.justify-content-between { display: none !important; }
/* We'll use our own divider */
.ap-divider-real {
    display: flex; align-items: center; gap: 10px;
    font-size: 12.5px; color: #c2cad2;
    margin: 20px 0;
}
.ap-divider-real::before, .ap-divider-real::after {
    content: ''; flex: 1; height: 1px; background: #e4e9ef;
}

/* ════════════════════════════════════
   OTP INPUTS
════════════════════════════════════ */
#otp-input {
    display: flex !important;
    gap: 10px !important;
    justify-content: space-between !important;
    direction: ltr;
    margin-bottom: 8px;
}
#otp-input input.input-custom-auth {
    flex: 1 !important;
    height: 60px !important;
    width: auto !important;
    text-align: center !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    border-radius: 14px !important;
    padding: 0 !important;
    -moz-appearance: textfield;
}
#otp-input input.input-custom-auth::-webkit-outer-spin-button,
#otp-input input.input-custom-auth::-webkit-inner-spin-button { -webkit-appearance: none; }
#otp-input input.input-danger { border-color: #ef4444 !important; background: #fff5f5 !important; }

/* ════════════════════════════════════
   RESEND / LINKS
════════════════════════════════════ */
.ap-resend-wrap { text-align: center; margin: 14px 0; }
.ap-resend-wrap a,
.text-after-card-auth a {
    font-size: 13.5px; color: #0069BC;
    text-decoration: none; font-weight: 600;
}
.text-after-card-auth a.disabled { color: #a0aab4; pointer-events: none; }
.text-after-card-auth { margin: 14px 0; }

.ap-forgot {
    display: block; text-align: center;
    font-size: 13px; color: #0069BC;
    text-decoration: none; margin-top: 12px;
    transition: color 0.2s;
}
.ap-forgot:hover { color: #004c88; }
.ap-page .f-regular { font-size: 13px; color: #0069BC; text-decoration: none; display: block; text-align: center; margin-top: 12px; }
.ap-page .f-regular:hover { color: #004c88; }

/* ════════════════════════════════════
   TERMS / SUPPORT
════════════════════════════════════ */
.ap-terms,
.ap-page .terms {
    font-size: 12px !important; color: #9ca3af !important;
    text-align: center !important; margin-top: 18px !important;
    line-height: 1.7 !important;
}
.ap-page .terms a { color: #0069BC !important; text-decoration: none !important; }
.ap-page .terms a:hover { text-decoration: underline !important; }

.ap-support,
.ap-page a[href*="contact"] {
    display: flex !important; align-items: center !important; justify-content: center !important; gap: 6px !important;
    font-size: 13px !important; color: #8a96a3 !important; text-decoration: none !important;
    margin-top: 10px !important; transition: color 0.2s !important;
}
.ap-page a[href*="contact"]:hover { color: #0069BC !important; }

/* ════════════════════════════════════
   RETURN BACK LINK
════════════════════════════════════ */
.return-back-text {
    display: inline-flex !important; align-items: center !important; gap: 6px !important;
    font-size: 13px !important; color: #8a96a3 !important;
    text-decoration: none !important; margin-bottom: 12px !important;
}
.return-back-text:hover { color: #0069BC !important; }
.return-back-text i.bx { display: none !important; }
.return-back-text::before {
    content: '';
    display: inline-block;
    width: 18px; height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238a96a3'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
    background-size: contain; background-repeat: no-repeat;
    vertical-align: middle;
}

/* ════════════════════════════════════
   ERROR MESSAGE
════════════════════════════════════ */
#error-message { font-size: 12px; color: #ef4444; display: block; margin-top: 6px; min-height: 18px; }

/* ════════════════════════════════════
   RESPONSIVE
════════════════════════════════════ */
@media (max-width: 960px) {
    .ap-left { width: 340px; padding: 40px 36px; }
    .ap-left-title { font-size: 1.5rem; }
}

@media (max-width: 768px) {
    .ap-left { display: none; }
    .ap-page { min-height: 100dvh; }
    .ap-right {
        background: linear-gradient(160deg, #003d70 0%, #0069BC 55%, #0cc0cf 100%);
        padding: 24px 16px 48px;
        align-items: flex-start;
        justify-content: flex-start;
        min-height: 100dvh;
        overflow-y: auto;
    }
    .ap-card {
        background: #fff;
        border-radius: 28px;
        padding: 28px 20px 24px;
        box-shadow: 0 20px 64px rgba(0,0,0,0.2);
        width: 100%;
    }
    .ap-card-logo { display: block !important; }
    .ap-card-title { font-size: 1.15rem; }
    /* OTP inputs fit better on mobile */
    #otp-input { gap: 8px !important; }
    #otp-input input.input-custom-auth { height: 54px !important; font-size: 1.35rem !important; }
}

@media (min-width: 769px) {
    .ap-card-logo { display: none !important; }
}

@media (max-width: 420px) {
    .ap-right { padding: 20px 12px 36px; }
    .ap-card { border-radius: 22px; padding: 24px 16px 22px; }
    #otp-input { gap: 7px !important; }
    #otp-input input.input-custom-auth { height: 52px !important; font-size: 1.25rem !important; border-radius: 12px !important; }
}
