/* Digits Lite — Auth Page */

/* Hide Theme Header/Footer */
body.digits-lite-auth-page header,
body.digits-lite-auth-page footer,
body.digits-lite-auth-page #masthead,
body.digits-lite-auth-page #colophon,
body.digits-lite-auth-page .site-header,
body.digits-lite-auth-page .site-footer {
    display: none !important;
}

body.digits-lite-auth-page .entry-content,
body.digits-lite-auth-page .page-content,
body.digits-lite-auth-page main .wp-block-post-content {
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.digits-lite-auth-page {
    background: transparent !important;
}

.dl-auth-page {
    --dl-primary: #0d9488;
    --dl-primary-dark: #0f766e;
    --dl-primary-light: #ccfbf1;
    --dl-text: #0f172a;
    --dl-muted: #64748b;
    --dl-border: #e2e8f0;
    --dl-bg: #f0fdfa;
    --dl-card: #ffffff;
    --dl-error: #dc2626;
    --dl-success: #059669;
    --dl-radius: 18px;
    --dl-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    color: var(--dl-text);
    box-sizing: border-box;
    background: linear-gradient(160deg, #f0fdfa 0%, #ecfeff 45%, #f8fafc 100%);
    z-index: 9999;
    overflow-y: auto;
}

.dl-auth-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.dl-auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px; /* Centered and narrower */
    padding: 1rem;
}

.dl-auth-card {
    background: var(--dl-card);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--dl-radius);
    box-shadow: var(--dl-shadow);
    padding: 2rem 1.5rem;
    animation: dlFadeUp 0.45s ease;
}

/* Progress Bar Simplified */
.dl-auth-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.dl-auth-progress__dot {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #94a3b8;
    border: 2px solid #e2e8f0;
}

.dl-auth-progress__item.is-active .dl-auth-progress__dot {
    background: var(--dl-primary);
    border-color: var(--dl-primary);
    color: #fff;
}

.dl-auth-progress__line {
    width: 20px;
    height: 2px;
    background: #e2e8f0;
}

.dl-auth-progress__line.is-done {
    background: var(--dl-primary);
}

/* Alerts & Panels */
.dl-auth-alert {
    min-height: 0;
    margin-bottom: 1rem;
    padding: 0;
    font-size: 0.9rem;
    text-align: center;
}
.dl-auth-alert:not(:empty) {
    padding: 0.65rem;
    border-radius: 8px;
}
.dl-auth-alert.is-info { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.dl-auth-alert.is-error { background: #fef2f2; color: var(--dl-error); border: 1px solid #fecaca; }

.dl-auth-panel { display: none; animation: dlFadeUp 0.3s ease; }
.dl-auth-panel.is-active { display: block; }

.dl-auth-panel__head { text-align: center; margin-bottom: 1.5rem; }
.dl-auth-panel__head h2 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.dl-auth-panel__head p { margin: 0; color: var(--dl-muted); font-size: 0.9rem; }

/* Inputs */
.dl-field { display: block; margin-bottom: 1rem; }
.dl-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.dl-field__label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
}

.dl-field input {
    width: 100%;
    padding: 0.78rem 0.9rem;
    border: 1.5px solid var(--dl-border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.dl-field input:focus {
    outline: none;
    border-color: var(--dl-primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.14);
}

.dl-phone-input {
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--dl-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.dl-phone-input:focus-within {
    border-color: var(--dl-primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.14);
}
.dl-phone-input__prefix {
    display: inline-flex;
    align-items: center;
    padding: 0 0.85rem;
    background: #f8fafc;
    border-left: 1px solid var(--dl-border);
    color: #475569;
    font-weight: 600;
    direction: ltr;
}
.dl-phone-input input {
    border: 0;
    box-shadow: none !important;
    direction: ltr;
    text-align: left;
}

/* OTP Inputs */
.dl-otp-group {
    display: flex;
    justify-content: center;
    gap: 0.55rem;
    margin-bottom: 1.25rem;
    direction: ltr;
}
.dl-otp-input {
    width: 3rem;
    height: 3.4rem;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    border: 1.5px solid var(--dl-border);
    border-radius: 12px;
}
.dl-otp-input:focus {
    outline: none;
    border-color: var(--dl-primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.14);
}

/* Buttons */
.dl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.82rem 1.25rem;
    border: 0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
}
.dl-btn--block { width: 100%; }
.dl-btn--primary {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 55%, #0f766e 100%);
    color: #fff;
    box-shadow: 0 10px 24px rgba(13, 148, 136, 0.28);
}
.dl-btn--primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(13, 148, 136, 0.32);
}
.dl-btn:disabled, .dl-btn.is-loading { opacity: 0.72; cursor: not-allowed; }

.dl-btn__spinner {
    display: none;
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: dlSpin 0.7s linear infinite;
    margin-left: 0.5rem;
}
.dl-btn.is-loading .dl-btn__spinner { display: inline-block; }

/* Footer Links & Credit */
.dl-auth-footer-links {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}
.dl-link {
    border: 0;
    background: transparent;
    color: var(--dl-primary-dark);
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    padding: 0.25rem 0;
    text-decoration: underline;
}
.dl-link:disabled { color: #94a3b8; text-decoration: none; cursor: not-allowed; }

.dl-footer-credit {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    font-size: 0.85rem;
    color: var(--dl-muted);
    z-index: 2;
}
.dl-footer-credit a {
    color: var(--dl-primary-dark);
    text-decoration: none;
    font-weight: 600;
}
.dl-footer-credit a:hover { text-decoration: underline; }

/* Animations */
@keyframes dlFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes dlSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .dl-auth-shell { max-width: 100%; padding: 1rem; }
    .dl-field-row { grid-template-columns: 1fr; }
    .dl-otp-input { width: 2.65rem; height: 3rem; }
}

/* ... (Previous CSS remains same) ... */

/* Fix Phone Input Direction & Layout */
.dl-phone-input {
    display: flex !important;
    flex-direction: row !important; /* چیدمان المان‌ها از چپ به راست */
    align-items: center !important;
    border: 1.5px solid var(--dl-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    direction: ltr !important; /* اجبار کل کادر به رفتار لفت‌تو‌رایت */
}

.dl-phone-input__prefix {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important; /* ایجاد فاصله استاندارد بین پرچم و کد 98+ */
    padding: 0 0.85rem !important;
    background: #f8fafc;
    border-right: 1px solid var(--dl-border) !important; /* خط جداکننده در سمت راست باکس */
    border-left: 0 !important;
    color: #475569;
    font-weight: 600;
    height: 100%;
    min-height: 48px;
    order: 1 !important; /* اولویت اول: قرارگیری در مطلق‌ترین نقطه سمت چپ */
}

/* تزریق هوشمند پرچم رسمی ایران بدون نیاز به فایل پیوست یا تغییر PHP */
.dl-phone-input__prefix::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='1000' height='572.2' viewBox='-7.217 -4.129 1000 572.2'%3E%3Cpath d='M-7.217-4.129h1000v572.2h-1000z' fill='%23239f40'/%3E%3Cpath d='M-7.217 281.971h1000v286.1h-1000z' fill='%23da0000'/%3E%3Cpath d='M-7.217 186.571h1000v190.75h-1000z' fill='%23fff'/%3E%3Cg transform='translate(-7.217 155.471) scale(4.4445)'%3E%3Cg id='e'%3E%3Cg id='c' fill='none' stroke='%23fff'%3E%3Cpath id='b' d='M3 .5h13M3.5 5V2.5h4v2h4v-2H9m-4 2h1m10 0h-2.5v-2h4m0-2.5v4.5h4V0m-2 0v4.5'/%3E%3Cpath id='a' d='M3 7h9m1 0h9' stroke-width='2'/%3E%3Cuse xlink:href='%23a' y='42.913' width='100%25' height='100%25'/%3E%3Cuse xlink:href='%23b' y='51.913' width='100%25' height='100%25'/%3E%3C/g%3E%3Cg id='d'%3E%3Cuse xlink:href='%23c' x='20' width='100%25' height='100%25'/%3E%3Cuse xlink:href='%23c' x='40' width='100%25' height='100%25'/%3E%3Cuse xlink:href='%23c' x='60' width='100%25' height='100%25'/%3E%3C/g%3E%3C/g%3E%3Cuse xlink:href='%23d' x='60' width='100%25' height='100%25'/%3E%3Cuse xlink:href='%23e' x='140' width='100%25' height='100%25'/%3E%3C/g%3E%3Cg transform='matrix(69.285 0 0 69.285 492.783 281.971)' fill='%23da0000'%3E%3Cg id='f'%3E%3Cpath d='M-.548.836A.912.912 0 0 0 .329-.722 1 1 0 0 1-.548.836'/%3E%3Cpath d='M.618.661A.764.764 0 0 0 .422-.74 1 1 0 0 1 .618.661M0 1l-.05-1L0-.787a.31.31 0 0 0 .118.099V-.1l-.04.993zM-.02-.85L0-.831a.144.144 0 0 0 .252-.137A.136.136 0 0 1 0-.925'/%3E%3C/g%3E%3Cuse xlink:href='%23f' transform='scale(-1 1)' width='100%25' height='100%25'/%3E%3C/g%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 1px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}

.dl-phone-input input {
    border: 0 !important;
    box-shadow: none !important;
    text-align: left !important; /* نوشتن شماره از چپ به راست درست در کنار پیش‌شماره */
    direction: ltr !important;
    flex-grow: 1 !important;
    padding: 0 0.85rem !important;
    order: 2 !important; /* اولویت دوم: قرارگیری بعد از باکس پیش‌شماره */
}

/* Username Status Styles */
.dl-username-status {
    display: block;
    font-size: 0.8rem;
    margin-top: 4px;
    min-height: 1.2em;
}
.dl-username-status.checking { color: #94a3b8; }
.dl-username-status.success { color: #059669; }
.dl-username-status.error { color: #dc2626; }

.dl-suggest-btn {
    background: none;
    border: none;
    color: #0d9488;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.8rem;
    padding: 0;
    margin-right: 5px;
}

/* Footer Credit */
.dl-footer-credit {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    font-size: 0.85rem;
    color: var(--dl-muted);
    z-index: 2;
}
.dl-footer-credit a {
    color: var(--dl-primary-dark);
    text-decoration: none;
    font-weight: 600;
}