@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --teal: #12b8a6;
    --teal-dark: #0d9183;
    --dark: #33383d;
    --muted: #667085;
    --bg: #f3fbfa;
    --white: #ffffff;
    --shadow: 0 24px 80px rgba(17, 24, 39, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(18, 184, 166, 0.18), transparent 34rem),
        linear-gradient(135deg, #ffffff 0%, var(--bg) 100%);
    color: var(--dark);
    min-height: 100vh;
}

.public-body a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px clamp(20px, 5vw, 72px);
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 900;
    font-size: 20px;
}

.site-brand img {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.12);
}

.header-login {
    padding: 12px 20px;
    border-radius: 999px;
    background: #fff;
    color: var(--teal-dark);
    font-weight: 800;
    border: 1px solid rgba(18, 184, 166, 0.22);
    box-shadow: 0 10px 30px rgba(18, 184, 166, 0.13);
}

.hero {
    display: grid;
    grid-template-columns: 1fr minmax(320px, 520px);
    gap: 36px;
    align-items: center;
    padding: 24px clamp(20px, 5vw, 72px) 16px;
    min-height: 620px;
}

.hero-content {
    max-width: 760px;
}

.eyebrow {
    display: inline-flex;
    padding: 10px 16px;
    border-radius: 999px;
    color: var(--teal-dark);
    background: rgba(18, 184, 166, 0.12);
    font-weight: 800;
    margin-bottom: 18px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(34px, 6vw, 64px);
    line-height: 1.22;
    letter-spacing: -1px;
}

.hero p {
    margin: 22px 0 0;
    max-width: 640px;
    color: var(--muted);
    font-size: 18px;
    line-height: 2;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 32px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 26px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    color: #fff;
    font-weight: 900;
    box-shadow: 0 18px 35px rgba(18, 184, 166, 0.28);
}

.version-badge {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    border: 1px solid rgba(102, 112, 133, 0.16);
}

.hero-visual {
    position: relative;
    min-height: 560px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
}

.circle-bg {
    position: absolute;
    width: 430px;
    height: 430px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(18, 184, 166, 0.22), rgba(255, 255, 255, 0.86));
    box-shadow: var(--shadow);
    bottom: 22px;
}

.assistant-img {
    position: relative;
    z-index: 2;
    max-width: 620px;
    width: 120%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 26px 50px rgba(17, 24, 39, 0.18));
}

.feature-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 0 clamp(20px, 5vw, 72px) 42px;
}

.feature-strip article {
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(18, 184, 166, 0.16);
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 16px 45px rgba(17, 24, 39, 0.07);
}

.feature-strip strong,
.feature-strip span {
    display: block;
}

.feature-strip strong {
    color: var(--dark);
    font-size: 17px;
    margin-bottom: 8px;
}

.feature-strip span {
    color: var(--muted);
    line-height: 1.8;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    padding: 24px clamp(20px, 5vw, 72px);
    border-top: 1px solid rgba(102, 112, 133, 0.12);
}

@media (max-width: 920px) {
    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .hero-visual {
        min-height: 420px;
    }

    .assistant-img {
        width: 100%;
        max-width: 520px;
    }

    .feature-strip {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .site-header,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero h1 {
        font-size: 34px;
    }

    .circle-bg {
        width: 310px;
        height: 310px;
    }
}

/* Phase 3: secure download page */
.download-header {
    padding-bottom: 10px;
}

.download-page {
    min-height: calc(100vh - 180px);
    display: grid;
    place-items: center;
    padding: 26px clamp(20px, 5vw, 72px) 46px;
}

.download-card {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: minmax(280px, 440px) 1fr;
    gap: 34px;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(18, 184, 166, 0.18);
    border-radius: 34px;
    box-shadow: var(--shadow);
    padding: clamp(20px, 4vw, 38px);
    overflow: hidden;
}

.download-cover-box {
    width: 100%;
}

.download-cover,
.download-cover-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 28px;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(18, 184, 166, 0.12), rgba(255, 255, 255, 0.92));
    border: 1px solid rgba(18, 184, 166, 0.14);
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.09);
}

.download-cover-placeholder {
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--muted);
    font-weight: 800;
}

.download-cover-placeholder img {
    width: 120px;
    height: 120px;
    border-radius: 28px;
    object-fit: cover;
    margin-bottom: 12px;
}

.download-info h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.35;
}

.download-info p {
    color: var(--muted);
    line-height: 2;
    font-size: 16px;
}

.download-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 26px 0;
}

.download-meta-grid div {
    background: #fff;
    border: 1px solid rgba(102, 112, 133, 0.14);
    border-radius: 18px;
    padding: 14px 16px;
}

.download-meta-grid strong,
.download-meta-grid span {
    display: block;
}

.download-meta-grid strong {
    margin-bottom: 6px;
    color: var(--dark);
}

.download-meta-grid span {
    color: var(--muted);
    direction: ltr;
    text-align: right;
}

.download-button {
    min-width: 220px;
}

.download-note {
    margin: 16px 0 0;
    font-size: 14px !important;
}

.download-footer {
    border-top: 0;
}

.error-page {
    text-align: center;
}

.error-card {
    display: grid;
    place-items: center;
    max-width: 680px;
    min-height: 420px;
    grid-template-columns: 1fr;
}

.error-icon {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(192, 57, 43, 0.1);
    color: #c0392b;
    font-size: 46px;
    font-weight: 900;
}

.error-card h1 {
    margin: 8px 0 0;
    font-size: 30px;
}

.error-card p {
    color: var(--muted);
    line-height: 2;
}

@media (max-width: 860px) {
    .download-card {
        grid-template-columns: 1fr;
    }

    .download-cover-box {
        max-width: 420px;
        margin: 0 auto;
    }
}

@media (max-width: 560px) {
    .download-meta-grid {
        grid-template-columns: 1fr;
    }

    .download-button {
        width: 100%;
    }
}

/* Phase 4 public collection and upload screens */
.collection-page,.upload-page{max-width:1120px}.collection-card,.upload-card{display:block}.collection-info{max-width:none}.collection-table-card,.upload-form-card{display:block;margin-top:18px}.public-table-wrap{width:100%;overflow-x:auto}.public-table{width:100%;border-collapse:collapse;min-width:720px}.public-table th,.public-table td{padding:14px 12px;border-bottom:1px solid #e5eeee;text-align:right;vertical-align:middle}.public-table th{font-size:13px;color:#516770;background:#f7fbfb}.public-table td strong{display:block;color:#223238}.public-table td small{display:block;color:#72828a;margin-top:4px}.public-cover-thumb{width:74px;height:54px;object-fit:cover;border-radius:12px;border:1px solid #e6eeee}.public-cover-placeholder{width:74px;height:54px;border-radius:12px;background:#eef8f7;display:flex;align-items:center;justify-content:center;color:#12a693;font-weight:700}.public-download-btn{padding:10px 14px;font-size:13px;white-space:nowrap}.public-upload-form{display:grid;gap:16px;width:100%}.public-upload-form label{display:grid;gap:7px;color:#33424a;font-weight:700}.public-upload-form input,.public-upload-form textarea{width:100%;border:1px solid #d8e5e7;border-radius:14px;padding:13px 14px;font-family:inherit;font-size:15px;background:#fff}.public-upload-form small{font-weight:400;color:#72828a}.public-alert{max-width:980px;margin:0 auto 14px;border-radius:16px;padding:14px 18px;font-weight:700}.public-alert.success{background:#e9f9f3;color:#096b42;border:1px solid #bcebd7}.public-alert.error{background:#ffefef;color:#9d1c1c;border:1px solid #ffd0d0}.empty-state{padding:22px;color:#6a7b82;text-align:center}.download-note{font-size:13px;color:#6d7d83}.download-meta-grid{margin-top:16px}
@media(max-width:720px){.public-table{min-width:620px}.public-upload-form input,.public-upload-form textarea{font-size:14px}.download-card{padding:18px}}

/* Patch 06: local Vazirmatn and stronger mobile layout */
html {
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
}

body,
button,
input,
select,
textarea {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
}

@media (max-width: 760px) {
    .site-header {
        padding: 16px;
        gap: 12px;
    }

    .site-brand {
        font-size: 17px;
    }

    .site-brand img {
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }

    .header-login {
        padding: 10px 14px;
        font-size: 14px;
    }

    .hero {
        padding: 12px 16px 8px;
        gap: 16px;
    }

    .hero p {
        font-size: 15px;
        line-height: 2;
    }

    .hero-actions,
    .site-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .btn-primary,
    .download-button {
        width: 100%;
    }

    .hero-visual {
        min-height: 300px;
    }

    .assistant-img {
        max-width: 360px;
    }

    .feature-strip {
        padding: 12px 16px 28px;
        gap: 12px;
    }

    .download-page {
        padding: 12px 14px 28px;
        place-items: start center;
    }

    .download-card {
        border-radius: 24px;
        padding: 16px;
        gap: 18px;
    }

    .download-info h1 {
        font-size: 24px;
    }

    .download-info p {
        font-size: 14px;
    }

    .download-cover,
    .download-cover-placeholder {
        border-radius: 22px;
    }

    .download-meta-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 18px 0;
    }

    .public-table {
        min-width: 620px;
    }

    .public-upload-form input,
    .public-upload-form textarea,
    .public-upload-form button {
        font-size: 16px;
    }
}

@media (max-width: 420px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-login {
        width: 100%;
        text-align: center;
    }

    .hero h1 {
        font-size: 28px;
    }

    .circle-bg {
        width: 260px;
        height: 260px;
    }
}
