@font-face {
    font-family: Yekan;
    src: url(../fonts/YekanBakhFaNum-Regular.woff2);
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Yekan;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #16a34a;
    --primary-dark: #15803d;

    --bg-body: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 50%, #d6e4f0 100%);
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --bg-tab: #f0f4f8;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-label: #475569;
    --border-color: #e2e8f0;
    --shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --success-text: #065f46;
}

body.dark {
    --bg-body: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    --bg-card: #1e293b;
    --bg-input: #334155;
    --bg-tab: #334155;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-label: #cbd5e1;
    --border-color: #475569;
    --shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    --success-bg: rgba(22, 163, 74, 0.15);
    --success-border: #16a34a;
    --success-text: #4ade80;
}

html,
body {
    height: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-x: hidden;
    transition: background 0.3s ease;
}

.container {
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    position: relative;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.theme-toggle {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: background 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.4);
}

body.dark .theme-toggle {
    background: rgba(0, 0, 0, 0.3);
}

.logo-section {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 22px 16px 18px;
    text-align: center;
    position: relative;
}

.logo-section::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    right: 0;
    height: 32px;
    background: var(--bg-card);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    transition: background 0.3s ease;
}

.logo-box {
    width: 68px;
    height: 68px;
    margin: 0 auto 10px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-box i {
    font-size: 30px;
    color: white;
}

.logo-section h1 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 3px;
}

.logo-section p {
    font-size: 12px;
    opacity: 0.9;
}

.tabs {
    display: flex;
    padding: 12px 16px 0;
    gap: 8px;
    margin-top: 8px;
}

.tab {
    flex: 1;
    padding: 12px 8px;
    text-align: center;
    background: var(--bg-tab);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
}

.tab i {
    margin-left: 4px;
    font-size: 13px;
}

.tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.form-container {
    padding: 20px 16px 24px;
}

.form {
    display: none;
}

.form.active {
    display: block;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-label);
    margin-bottom: 6px;
}

.form-group label i {
    margin-left: 4px;
    color: var(--primary);
    font-size: 12px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i.icon-left {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.form-group input {
    width: 100%;
    padding: 13px 40px 13px 40px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-main);
    background: var(--bg-input);
    outline: none;
    -webkit-appearance: none;
    transition: border-color 0.3s ease, background 0.3s ease;
    direction: rtl;
    text-align: right;
}

.form-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.form-group input:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.form-group input:focus+i.icon-left {
    color: var(--primary);
}

.form-group input.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.error-message {
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
    display: none;
}

.error-message.show {
    display: block;
}

.toggle-password {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    padding: 4px;
}

.toggle-password:hover {
    color: var(--primary);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.checkbox-group input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-group a {
    color: var(--primary);
    text-decoration: none;
}

.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: opacity 0.3s ease;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.form-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.form-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.success-message {
    display: none;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 14px;
    font-size: 13px;
}

.success-message.show {
    display: block;
}

/* موبایل */
@media (max-width: 480px) {
    body {
        padding: 20px 14px;
        align-items: center;
        justify-content: center;
    }

    .container {
        border-radius: 18px;
        max-width: 100%;
    }

    .logo-section {
        padding: 24px 16px 20px;
    }

    .logo-box {
        width: 72px;
        height: 72px;
        margin-bottom: 12px;
    }

    .logo-box i {
        font-size: 32px;
    }

    .logo-section h1 {
        font-size: 18px;
    }

    .logo-section p {
        font-size: 12.5px;
    }

    .tabs {
        padding: 12px 16px 0;
        margin-top: 10px;
    }

    .tab {
        padding: 13px 8px;
        font-size: 14px;
    }

    .form-container {
        padding: 22px 16px 28px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-group input {
        padding: 14px 42px 14px 42px;
        font-size: 15px;
    }

    .btn {
        padding: 15px;
        font-size: 15px;
    }
}

@media (max-width: 360px) {
    body {
        padding: 16px 12px;
    }

    .logo-section {
        padding: 20px 14px 16px;
    }

    .logo-box {
        width: 64px;
        height: 64px;
    }

    .logo-box i {
        font-size: 28px;
    }

    .logo-section h1 {
        font-size: 16px;
    }

    .tab {
        font-size: 13px;
        padding: 12px 6px;
    }

    .form-container {
        padding: 18px 14px 24px;
    }

    .form-group input {
        font-size: 14px;
        padding: 13px 40px 13px 40px;
    }
}

/* ---------- the theme's pages login.html has no design for (inc/otp.php): signing in with a one-time code, the
   code page and password recovery, in the card's own colours, radii and sizes ---------- */
.or-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
    font-size: 12px;
    color: var(--text-muted);
}

.or-line::before,
.or-line::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    box-shadow: none;
    transition: background 0.3s ease;
}

.btn-outline:hover {
    background: rgba(22, 163, 74, 0.08);
}

body.dark .btn-outline {
    color: #4ade80;
    border-color: #22c55e;
}

.otp-head {
    text-align: center;
    margin-bottom: 18px;
}

.otp-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 10px;
    border-radius: 14px;
    background: rgba(22, 163, 74, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

body.dark .otp-icon {
    background: rgba(22, 163, 74, 0.18);
    color: #4ade80;
}

.otp-head h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.otp-head p {
    font-size: 13px;
    line-height: 1.9;
    color: var(--text-muted);
}

.otp-head bdi {
    color: var(--text-main);
    font-weight: 600;
}

.otp-edit {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
}

.otp-edit i {
    font-size: 11px;
}

.otp-group label {
    text-align: center;
}

/* the boxes' size, and their shake at a wrong code, are the client's otp.html */
.otp-boxes {
    display: flex;
    justify-content: center;
    gap: 10px;
    direction: ltr;
}

.otp-boxes input {
    width: 48px;
    height: 56px;
    padding: 0;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    direction: ltr;
    caret-color: var(--primary);
}

.otp-boxes input.filled {
    border-color: var(--primary);
}

.otp-boxes.error input {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.otp-boxes.error {
    animation: otp-shake 0.35s;
}

@keyframes otp-shake {
    25% {
        transform: translateX(-6px);
    }

    75% {
        transform: translateX(6px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .otp-boxes.error {
        animation: none;
    }
}

.otp-group + .notice-box {
    margin-top: -2px;
}

.otp-again {
    margin-top: 14px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.otp-timer b {
    color: var(--text-main);
    font-weight: 600;
}

.link-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
}

.link-btn i {
    margin-left: 3px;
    font-size: 12px;
}

.otp-alt {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    line-height: 1.8;
    color: var(--text-muted);
}

/* six boxes and their gaps fit the card's inner width: 338px from 421px up, 282px down to 341px, 253px below */
@media (max-width: 420px) {
    .otp-boxes {
        gap: 6px;
    }

    .otp-boxes input {
        width: 42px;
        height: 50px;
        font-size: 20px;
    }
}

@media (max-width: 340px) {
    .otp-boxes {
        gap: 5px;
    }

    .otp-boxes input {
        width: 38px;
        height: 46px;
        font-size: 18px;
    }
}