/* استایل فرم فرانت - سپهرلاگین */
.sepehr-login-wrapper {
    margin: 0 auto;
    width: var(--sepehr-form-width, 100%);
    max-width: var(--sepehr-form-max-width, 420px);
    min-height: var(--sepehr-form-min-height, auto);
    margin: 40px auto;
    padding: 0 16px;
    box-sizing: border-box;
}

.sepehr-login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
}

.sepehr-login-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.sepehr-tab {
    flex: 1;
    padding: 16px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.sepehr-tab.active {
    color: var(--sepehr-primary, #4f46e5);
    background: #fff;
}

.sepehr-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--sepehr-primary, #4f46e5);
    border-radius: 3px 3px 0 0;
}

.sepehr-panel {
    padding: 28px 24px 32px;
}

.sepehr-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
}

.sepehr-desc {
    margin: 0 0 24px;
    font-size: 13px;
    color: #64748b;
    text-align: center;
    line-height: 1.6;
}

.sepehr-field {
    margin-bottom: 16px;
}

.sepehr-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
}

.sepehr-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background: #fff;
    color: #0f172a;
}

.sepehr-input:focus {
    outline: none;
    border-color: var(--sepehr-primary, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.sepehr-channels {
    margin-bottom: 20px;
}

.sepehr-channels-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
}

.sepehr-channel-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sepehr-channel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    background: #fff;
}

.sepehr-channel:has(input:checked) {
    border-color: var(--sepehr-primary, #4f46e5);
    background: rgba(79, 70, 229, 0.06);
    color: var(--sepehr-primary, #4f46e5);
}

.sepehr-channel input {
    margin: 0;
    accent-color: var(--sepehr-primary, #4f46e5);
}

.sepehr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    box-sizing: border-box;
}

.sepehr-btn-primary {
    background: var(--sepehr-primary, #4f46e5);
    color: #fff;
}

.sepehr-btn-primary:hover {
    background: var(--sepehr-primary-hover, #4338ca);
}

.sepehr-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.sepehr-btn-outline {
    background: transparent;
    border: 1.5px solid #e2e8f0;
    color: #334155;
    margin-top: 10px;
}

.sepehr-btn-outline:hover {
    border-color: var(--sepehr-primary, #4f46e5);
    color: var(--sepehr-primary, #4f46e5);
}

.sepehr-btn-link {
    background: transparent;
    color: #64748b;
    font-weight: 500;
    font-size: 13px;
    margin-top: 12px;
    padding: 8px;
}

.sepehr-btn-link:hover {
    color: var(--sepehr-primary, #4f46e5);
}

.sepehr-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #94a3b8;
    font-size: 12px;
}

.sepehr-divider::before,
.sepehr-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.sepehr-divider span {
    padding: 0 12px;
}

/* OTP Inputs */
.sepehr-otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
    direction: ltr;
}

.sepehr-otp-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s;
}

.sepehr-otp-digit:focus {
    outline: none;
    border-color: var(--sepehr-primary, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.sepehr-messages {
    padding: 0 24px 20px;
}

.sepehr-message {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 12px;
    line-height: 1.5;
}

.sepehr-message.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.sepehr-message.success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.sepehr-login-logged-in {
    text-align: center;
    padding: 40px 20px;
}

/* Minimal style */
.sepehr-style-minimal.sepehr-login-card {
    box-shadow: none;
    border: 1px solid #e2e8f0;
}

/* Classic */
.sepehr-style-classic.sepehr-login-card {
    border-radius: 4px;
}

.sepehr-style-classic.sepehr-btn {
    border-radius: 4px;
}

.sepehr-style-classic.sepehr-input {
    border-radius: 4px;
}

/* Loading spinner */
.sepehr-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sepehr-spin 0.6s linear infinite;
}

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

@media (max-width: 480px) {
.sepehr-login-wrapper {
        margin: 20px auto;
    }
 .sepehr-otp-digit {
        width: 42px;
        height: 50px;
        font-size: 18px;
    }
}

/* Popup */
.sepehr-popup-overlay{position:fixed;inset:0;background:rgba(15,23,42,.55);backdrop-filter:blur(4px);z-index:99999;display:flex;align-items:center;justify-content:center;padding:16px}
.sepehr-popup-modal{position:relative;width:100%;max-width:440px;max-height:90vh;overflow-y:auto}
.sepehr-popup-modal.sepehr-login-wrapper{margin:0;max-width:100%;padding:0}
.sepehr-popup-close{position:absolute;top:10px;left:12px;z-index:10;width:36px;height:36px;border:none;background:rgba(0,0,0,.06);border-radius:50%;font-size:22px;cursor:pointer;color:#334155}

.sepehr-math-captcha {
  margin: 12px 0 16px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.sepehr-math-captcha label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: #334155;
}
.sepehr-math-captcha strong {
  color: #4f46e5;
  font-size: 15px;
  letter-spacing: 0.5px;
}
.sepehr-math-captcha input.sepehr-input {
  max-width: 140px;
}
.sepehr-recaptcha {
  margin: 12px 0;
  display: flex;
  justify-content: center;
}
.sepehr-otp-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: nowrap;
  direction: ltr;
  margin: 16px 0;
}
.sepehr-otp-digit {
  width: 48px;
  height: 48px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
}
.sepehr-otp-digit:focus {
  border-color: #4f46e5;
  outline: none;
  box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}


/* OTP boxes — مربعی و کنار هم */
.sepehr-login-wrapper .sepehr-otp-inputs,
.sepehr-otp-inputs {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  margin: 16px auto 24px !important;
  direction: ltr !important;
  width: 100% !important;
  max-width: 100% !important;
}
.sepehr-login-wrapper .sepehr-otp-digit,
.sepehr-otp-inputs .sepehr-otp-digit,
input.sepehr-otp-digit {
  display: inline-block !important;
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  height: 52px !important;
  flex: 0 0 48px !important;
  box-sizing: border-box !important;
  text-align: center !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 52px !important;
  background: #fff !important;
  color: #0f172a !important;
  float: none !important;
}
.sepehr-otp-inputs .sepehr-otp-digit:focus {
  border-color: var(--sepehr-primary, #4f46e5) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
  outline: none !important;
}
@media (max-width: 400px) {
  .sepehr-otp-inputs .sepehr-otp-digit,
  input.sepehr-otp-digit {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 46px !important;
    flex: 0 0 40px !important;
    font-size: 18px !important;
    line-height: 46px !important;
  }
}


/* FINAL OTP LAYOUT — مربعی یک‌ردیفه (override theme) */
body .sepehr-login-wrapper .sepehr-otp-inputs,
body .sepehr-otp-inputs {
  display: -webkit-box !important;
  display: -ms-flexbox !important;
  display: flex !important;
  -webkit-box-orient: horizontal !important;
  -webkit-box-direction: normal !important;
  -ms-flex-direction: row !important;
  flex-direction: row !important;
  -ms-flex-wrap: nowrap !important;
  flex-wrap: nowrap !important;
  -webkit-box-pack: center !important;
  -ms-flex-pack: center !important;
  justify-content: center !important;
  -webkit-box-align: center !important;
  -ms-flex-align: center !important;
  align-items: center !important;
  gap: 8px !important;
  direction: ltr !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 16px auto 20px !important;
}
body .sepehr-login-wrapper .sepehr-otp-inputs input,
body .sepehr-otp-inputs input.sepehr-otp-digit,
body input.sepehr-otp-digit {
  display: inline-block !important;
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  height: 52px !important;
  -webkit-box-flex: 0 !important;
  -ms-flex: 0 0 48px !important;
  flex: 0 0 48px !important;
  box-sizing: border-box !important;
  text-align: center !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 52px !important;
  background: #fff !important;
  color: #0f172a !important;
  float: none !important;
  vertical-align: middle !important;
}
