/* ================================================================
   KYC System - Styles (RTL / Persian)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');

:root {
    --primary:     #1a56db;
    --primary-dark:#1e429f;
    --success:     #057a55;
    --danger:      #c81e1e;
    --warning:     #c27803;
    --info:        #1c64f2;
    --gray-50:     #f9fafb;
    --gray-100:    #f3f4f6;
    --gray-200:    #e5e7eb;
    --gray-300:    #d1d5db;
    --gray-500:    #6b7280;
    --gray-700:    #374151;
    --gray-900:    #111827;
    --radius:      12px;
    --shadow:      0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.05);
    --shadow-lg:   0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    direction: rtl;
    font-size: 16px;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f5e9 100%);
    min-height: 100vh;
    color: var(--gray-900);
    line-height: 1.6;
}

/* ─── Layout ──────────────────────────────────────────── */

.container {
    max-width: 560px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.container-wide {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ─── Card ────────────────────────────────────────────── */

.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.card-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.card-header .logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
}

.card-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: .25rem;
}

.card-header p {
    color: var(--gray-500);
    font-size: .9rem;
}

/* ─── Form ────────────────────────────────────────────── */

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: .4rem;
}

label .required {
    color: var(--danger);
    margin-right: .2rem;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: .75rem 1rem;
    border: 1.5px solid var(--gray-300);
    border-radius: 8px;
    font-family: inherit;
    font-size: .95rem;
    color: var(--gray-900);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    direction: rtl;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.15);
}

input.error { border-color: var(--danger); }

.field-error {
    font-size: .8rem;
    color: var(--danger);
    margin-top: .3rem;
    display: block;
}

/* Phone input - LTR number */
input[type="tel"] {
    direction: ltr;
    text-align: right;
    letter-spacing: 1px;
}

/* ─── Buttons ─────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .8rem 1.75rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    width: 100%;
}

.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-loading::after {
    content: '';
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin-right: .5rem;
}

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

/* ─── Alert / Notice ──────────────────────────────────── */

.alert {
    padding: .9rem 1rem;
    border-radius: 8px;
    font-size: .9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: .6rem;
}

.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-success { background: #f0fdf4; color: #14532d; border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #78350f; border: 1px solid #fde68a; }
.alert-danger  { background: #fef2f2; color: #7f1d1d; border: 1px solid #fecaca; }

/* ─── Steps / Progress ────────────────────────────────── */

.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    flex: 1;
    position: relative;
}

.step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .875rem;
    border: 2px solid var(--gray-300);
    background: #fff;
    color: var(--gray-500);
    z-index: 1;
}

.step.active .step-num   { border-color: var(--primary); background: var(--primary); color: #fff; }
.step.done .step-num     { border-color: var(--success); background: var(--success); color: #fff; }

.step-label {
    font-size: .75rem;
    color: var(--gray-500);
    text-align: center;
}

.step.active .step-label { color: var(--primary); font-weight: 600; }

.step-line {
    height: 2px;
    background: var(--gray-200);
    flex: 1;
    margin-top: -10px;
}

/* ─── Nationality Toggle ──────────────────────────────── */

.nationality-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    margin-bottom: 1.5rem;
}

.nat-card {
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    user-select: none;
}

.nat-card:hover { border-color: var(--primary); background: #f5f8ff; }
.nat-card.selected { border-color: var(--primary); background: #eff6ff; }

.nat-card .icon { font-size: 2rem; margin-bottom: .5rem; }
.nat-card .title { font-weight: 600; color: var(--gray-700); }
.nat-card .desc  { font-size: .8rem; color: var(--gray-500); margin-top: .2rem; }

/* ─── File Upload Zone ────────────────────────────────── */

.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: var(--gray-50);
    position: relative;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: #eff6ff;
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-zone .icon    { font-size: 2rem; margin-bottom: .5rem; }
.upload-zone .title   { font-weight: 600; color: var(--gray-700); }
.upload-zone .hint    { font-size: .8rem; color: var(--gray-500); margin-top: .3rem; }

.upload-preview {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem;
    background: var(--gray-50);
    border-radius: 8px;
    margin-top: .5rem;
}

.upload-preview img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
.upload-preview .name { flex: 1; font-size: .875rem; color: var(--gray-700); word-break: break-all; }
.upload-preview .remove { cursor: pointer; color: var(--danger); font-size: 1.2rem; }

/* ─── Badge ───────────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: .2rem .65rem;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
}

.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-info     { background: #dbeafe; color: #1e40af; }
.badge-success  { background: #d1fae5; color: #065f46; }
.badge-danger   { background: #fee2e2; color: #991b1b; }
.badge-secondary{ background: var(--gray-200); color: var(--gray-700); }

/* ─── Table ───────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

th {
    background: var(--gray-50);
    padding: .75rem 1rem;
    text-align: right;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

tr:hover td { background: var(--gray-50); }

/* ─── Header ──────────────────────────────────────────── */

.site-header {
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.site-header .inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-header .brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* ─── Success Page ────────────────────────────────────── */

.success-box {
    text-align: center;
    padding: 2rem 0;
}

.success-box .check {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #059669, #10b981);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    animation: pop .4s cubic-bezier(.175,.885,.32,1.275);
}

@keyframes pop {
    0%   { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ─── Section Divider ─────────────────────────────────── */

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 1.5rem 0 1rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* ─── Responsive ──────────────────────────────────────── */

@media (max-width: 480px) {
    .card { padding: 1.25rem; }
    .container { padding: 1rem .75rem; }
    .nationality-toggle { grid-template-columns: 1fr; }
}

/* ─── Print ───────────────────────────────────────────── */

@media print {
    body { background: #fff; }
    .card { box-shadow: none; }
    .btn  { display: none; }
}
