@font-face {
    font-family: 'IRANSans';
    src: url('/static/fonts/IRANSans.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* =========================
   Reset & Base
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    direction: rtl;
}

body {
    font-family: 'IRANSans', Arial, sans-serif;
    direction: rtl;
    text-align: right;
    background: linear-gradient(135deg, #74ebd5, #9face6);
    min-height: 100vh;
    color: #333;
}

.hidden {
    display: none !important;
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font-family: 'IRANSans', Arial, sans-serif;
}

/* =========================
   Shared Layout Containers
========================= */
.page-container,
.login-container {
    min-height: 100vh;
    padding: calc(90px + env(safe-area-inset-top)) 20px 40px;
}

.page-container {
    width: 100%;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* =========================
   Shared Card Styles
========================= */
.card,
.panel,
.result-box,
.sidebar-box,
.form-box {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* =========================
   Typography
========================= */
h1 {
    color: #333;
    margin-bottom: 10px;
}

h2,
h3,
h4 {
    color: #2e3a59;
}

.subtitle {
    margin-bottom: 20px;
    color: #777;
    font-size: 14px;
    line-height: 1.9;
}

.error-text,
.field-error {
    color: #d93025;
    font-size: 13px;
    margin-top: 8px;
    text-align: right;
}

.success-message {
    background: #e8f7e8;
    color: #1f7a1f;
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

.info-message {
    margin-bottom: 16px;
    padding: 10px;
    background: #e8f7e8;
    color: #1f6b1f;
    border: 1px solid #b6e2b6;
    border-radius: 14px;
}

.error-message {
    margin-bottom: 16px;
    padding: 10px;
    background: #fdeaea;
    color: #8a1f1f;
    border: 1px solid #efb5b5;
    border-radius: 14px;
}

.empty-text {
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* =========================
   Form Elements
========================= */
.form-group {
    margin-bottom: 18px;
    text-align: right;
}

.form-group label,
.field-label {
    display: block;
    margin-bottom: 8px;
    color: #444;
    font-size: 14px;
    font-weight: bold;
    text-align: right;
}

.form-input,
input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 14px;
    font-size: 15px;
    outline: none;
    transition: 0.3s;
    background-color: #fff;
    color: #333;
}

input[type="text"],
input[type="number"],
textarea,
select {
    text-align: right;
    direction: rtl;
}

.form-input:focus,
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: #6c8cff;
    box-shadow: 0 0 0 3px rgba(108, 140, 255, 0.15);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

input:disabled,
textarea:disabled,
select:disabled {
    background: #f3f4f6 !important;
    color: #9aa3af !important;
    cursor: not-allowed;
}

/* =========================
   Buttons
========================= */
.btn,
button {
    transition: 0.3s;
}

.btn-primary,
.primary-btn {
    padding: 12px 18px;
    border: none;
    border-radius: 14px;
    background: #6c8cff;
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.btn-primary:hover,
.primary-btn:hover {
    background: #5677f0;
}

.btn-secondary,
.secondary-btn {
    padding: 12px 18px;
    border: 1px solid #d7e2ff;
    border-radius: 14px;
    background: #f7f9ff;
    color: #3556b3;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.btn-secondary:hover,
.secondary-btn:hover {
    background: #eaf0ff;
    border-color: #bfd0ff;
}

.btn-danger,
.danger-btn {
    background: #fff0f0;
    color: #c62828;
    border: 1px solid #f3caca;
    border-radius: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-danger:hover,
.danger-btn:hover {
    background: #ffe3e3;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* =========================
   Checkbox groups
========================= */
.form-multi-checkbox {
    display: block;
}

.form-multi-checkbox > div {
    margin-bottom: 8px;
}

.form-multi-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    background: #f5f7ff;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-multi-checkbox label:hover {
    background: #eef3ff;
    border-color: #d8e2ff;
}

.form-multi-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #6c8cff;
}

.form-multi-checkbox label:has(input:checked) {
    background: #eaf0ff;
    border-color: #b9cbff;
    box-shadow: 0 0 0 3px rgba(108, 140, 255, 0.08);
}

/* =========================
   Responsive
========================= */
@media (max-width: 900px) {
    .page-container,
    .login-container {
        padding: calc(75px + env(safe-area-inset-top)) 16px 30px;
    }
}

@media (max-width: 768px) {
    .form-input,
    input[type="text"],
    input[type="number"],
    textarea,
    select {
        font-size: 14px;
    }

    .btn-primary,
    .primary-btn,
    .btn-secondary,
    .secondary-btn {
        width: 100%;
    }
}

/* =========================
   OTP
========================= */
.otp-boxes {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
    direction: ltr;
}

.otp-input {
    width: 48px !important;
    height: 52px;
    border: 1px solid #ddd;
    border-radius: 14px;
    text-align: center !important;
    font-size: 20px;
    outline: none;
    transition: 0.3s;
    direction: ltr;
    font-family: 'IRANSans', Arial, sans-serif;
    padding: 0;
    min-width: 48px;
    max-width: 48px;
}

.otp-input:focus {
    border-color: #6c8cff;
    box-shadow: 0 0 0 3px rgba(108, 140, 255, 0.15);
}