@font-face {
    font-family: "Vazirmatn";
    src: url("font/Vazirmatn-Thin.woff2") format("woff2");
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("font/Vazirmatn-ExtraLight.woff2") format("woff2");
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("font/Vazirmatn-Light.woff2") format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("font/Vazirmatn-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("font/Vazirmatn-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("font/Vazirmatn-SemiBold.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("font/Vazirmatn-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("font/Vazirmatn-ExtraBold.woff2") format("woff2");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("font/Vazirmatn-Black.woff2") format("woff2");
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --font-main: "Vazirmatn", Tahoma, Arial, sans-serif;

    --page-bg: #f3f5f7;
    --card-bg: #ffffff;
    --text-main: #172033;
    --text-muted: #667085;
    --text-soft: #8a94a6;

    --border-soft: #e1e6ef;
    --border-strong: #c9d2e3;

    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-focus: rgba(37, 99, 235, 0.16);

    --danger: #dc2626;

    --readonly-bg: #f6f8fb;
    --readonly-text: #667085;

    --radius-lg: 10px;
    --radius-md: 8px;
    --radius-sm: 6px;

    --shadow-card: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    font-size: 16px;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(180deg, #f8fafc 0%, var(--page-bg) 100%);
    color: var(--text-main);
    font-family: var(--font-main);
    font-weight: 400;
    line-height: 1.7;
}

button,
input,
select,
textarea {
    font: inherit;
}

.page-shell {
    width: 100%;
    min-height: 100vh;
    padding: 40px 16px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.form-card {
    width: 100%;
    max-width: 920px;
    padding: 32px;
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.form-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-soft);
}

.form-header h1 {
    margin: 0;
    color: var(--text-main);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.4;
}

.form-description {
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
}

.form-group {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 7px;
    color: #2f3a4f;
    font-size: 13px;
    font-weight: 600;
}

.required {
    color: var(--danger);
    font-weight: 700;
}

input,
select {
    width: 100%;
    height: 44px;
    padding: 9px 12px;
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    outline: none;
    font-size: 14px;
    font-weight: 400;
    text-align: right;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        background-color 160ms ease;
}

select {
    cursor: pointer;
}

input::placeholder {
    color: var(--text-soft);
}

input:hover,
select:hover {
    border-color: #9aa8bd;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-focus);
}

input[readonly] {
    background: var(--readonly-bg);
    color: var(--readonly-text);
    cursor: default;
}

input[readonly]:focus {
    border-color: var(--border-strong);
    box-shadow: none;
}

input[type="date"] {
    direction: ltr;
    text-align: right;
}

.form-actions {
    margin-top: 28px;
}

button {
    width: 100%;
    min-height: 48px;
    padding: 10px 18px;
    background: var(--primary);
    color: #ffffff;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.6;
    transition:
        background-color 160ms ease,
        transform 120ms ease,
        box-shadow 160ms ease;
}

button:hover {
    background: var(--primary-hover);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

button:active {
    transform: translateY(1px);
}

button:focus-visible {
    outline: 3px solid rgba(147, 197, 253, 0.9);
    outline-offset: 3px;
}

@media (max-width: 760px) {
    .page-shell {
        padding: 20px 12px;
    }

    .form-card {
        padding: 22px 16px;
        border-radius: var(--radius-md);
    }

    .form-header {
        margin-bottom: 22px;
        padding-bottom: 16px;
    }

    .form-header h1 {
        font-size: 21px;
    }

    .form-description {
        font-size: 13px;
    }

    .form-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 15px;
    }

    input,
    select {
        height: 43px;
    }

    .form-actions {
        margin-top: 22px;
    }
}

@media (max-width: 420px) {
    .page-shell {
        padding: 12px 8px;
    }

    .form-card {
        padding: 18px 12px;
    }

    .form-header h1 {
        font-size: 19px;
    }

    button {
        min-height: 46px;
    }
}

/* ==========================================
   Result Pages: Success / Error
   Used by submit.php
========================================== */

.result-page {
    width: 100%;
    min-height: 100vh;
    padding: 40px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-card {
    width: 100%;
    max-width: 620px;
    padding: 36px 32px;
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    text-align: center;
}

.result-card h1 {
    margin: 18px 0 10px;
    color: var(--text-main);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.5;
}

.result-message {
    margin: 0;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.9;
}

.result-icon {
    width: 74px;
    height: 74px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
}

.result-icon-success {
    background: #ecfdf3;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.result-icon-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.result-card-success {
    border-top: 4px solid #22c55e;
}

.result-card-error {
    border-top: 4px solid #ef4444;
}

.record-id {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 22px;
    padding: 10px 16px;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
}

.record-id strong {
    font-weight: 800;
}

.submitted-info {
    margin-top: 24px;
    padding: 18px;
    background: #f8fafc;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    text-align: right;
}

.submitted-info-title {
    margin-bottom: 14px;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 800;
}

.submitted-info-list {
    margin: 0;
}

.submitted-info-list > div {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #e8edf5;
}

.submitted-info-list > div:last-child {
    border-bottom: 0;
}

.submitted-info-list dt {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
}

.submitted-info-list dd {
    min-width: 0;
    margin: 0;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.result-actions {
    margin-top: 26px;
    display: flex;
    justify-content: center;
}

.result-button {
    min-width: 180px;
    min-height: 44px;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
    text-decoration: none;
    transition:
        background-color 160ms ease,
        color 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        transform 120ms ease;
}

.result-button-primary {
    background: var(--primary);
    color: #ffffff;
    border: 1px solid var(--primary);
}

.result-button-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.result-button-secondary {
    background: #ffffff;
    color: var(--primary);
    border: 1px solid #bfdbfe;
}

.result-button-secondary:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.result-button:active {
    transform: translateY(1px);
}

.result-button:focus-visible {
    outline: 3px solid rgba(147, 197, 253, 0.9);
    outline-offset: 3px;
}

@media (max-width: 640px) {
    .result-page {
        padding: 20px 12px;
        align-items: flex-start;
    }

    .result-card {
        padding: 28px 18px;
    }

    .result-card h1 {
        font-size: 21px;
    }

    .result-icon {
        width: 64px;
        height: 64px;
        font-size: 31px;
    }

    .submitted-info {
        padding: 14px;
    }

    .submitted-info-list > div {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }

    .result-button {
        width: 100%;
    }

    .result-actions {
        width: 100%;
    }
}
