:root {
    --primary: #004d40;
    --primary-dark: #00352c;
    --primary-hover: #00695c;

    --secondary: #d4af37;
    --secondary-dark: #ad8424;

    --bg: #f8f3e8;
    --card-bg: #fffdf7;
    --text: #24302f;
    --muted: #6f7d78;
    --border: rgba(0, 77, 64, 0.15);

    --danger: #b42318;
    --info: #155eef;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 34px;

    --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 18px 45px rgba(0, 77, 64, 0.12);
    --shadow-lg: 0 28px 70px rgba(0, 45, 38, 0.22);

    --container: 1120px;
}

* {
    box-sizing: border-box;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    color: var(--text);
    line-height: 1.9;
    background:
        radial-gradient(circle at top right, rgba(0, 121, 107, 0.12), transparent 35%),
        radial-gradient(circle at bottom left, rgba(212, 175, 55, 0.18), transparent 34%),
        linear-gradient(180deg, #fffaf0 0%, var(--bg) 100%);
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
textarea,
select {
    font: inherit;
}

.hidden {
    display: none !important;
}

.hero {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    padding: 56px 20px 96px;
    background:
        radial-gradient(circle at 18% 20%, rgba(212, 175, 55, 0.22), transparent 28%),
        radial-gradient(circle at 76% 16%, rgba(0, 188, 174, 0.18), transparent 32%),
        linear-gradient(135deg, #002d27 0%, #004d40 48%, #00231f 100%);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.14;
    background-image:
        linear-gradient(45deg, rgba(255,255,255,0.08) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,0.08) 25%, transparent 25%);
    background-size: 78px 78px;
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 2;
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 46px;
    align-items: center;
}

.hero-copy {
    text-align: right;
}

.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 800;
}

.eyebrow {
    color: #ffe8a3;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-copy h1 {
    font-family: 'Lalezar', cursive;
    font-weight: normal;
    font-size: clamp(2.6rem, 6vw, 5rem);
    line-height: 1.08;
    margin: 18px 0;
    color: #ffffff;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.hero-subtitle {
    max-width: 600px;
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.08rem;
    line-height: 2.05;
}

.hero-visual img {
    width: 100%;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: var(--shadow-lg);
}

.api-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 800;
    box-shadow: 0 10px 28px rgba(0,0,0,0.14);
    transition: 0.25s ease;
}

.checking {
    background-color: rgba(255, 243, 224, 0.96);
    color: #9a6500;
    border: 1px solid rgba(255, 224, 178, 0.95);
}

.online {
    background-color: rgba(232, 245, 233, 0.96);
    color: #1b7f45;
    border: 1px solid rgba(200, 230, 201, 0.95);
}

.offline {
    background-color: rgba(255, 235, 238, 0.96);
    color: #b42318;
    border: 1px solid rgba(255, 205, 210, 0.95);
}

.container {
    position: relative;
    z-index: 5;
    max-width: var(--container);
    margin: -50px auto 64px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.card {
    background: rgba(255, 253, 247, 0.98);
    border: 1px solid rgba(0, 77, 64, 0.13);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-md);
}

.main-form-card {
    position: relative;
    overflow: hidden;
}

.main-form-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 7px;
    height: 100%;
    background: linear-gradient(180deg, var(--secondary), var(--primary));
}

.section-heading {
    margin-bottom: 22px;
}

.section-heading.compact {
    margin-bottom: 18px;
}

.section-kicker {
    color: var(--primary);
    background: rgba(212, 175, 55, 0.16);
    border: 1px solid rgba(212, 175, 55, 0.35);
}

.section-heading h2,
.section-heading h3,
.card h2 {
    margin: 12px 0 8px;
    color: var(--primary);
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.45;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 0.98rem;
}

.input-block {
    margin-bottom: 22px;
}

.field-label,
.field-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-dark);
    font-size: 0.94rem;
    font-weight: 800;
}

textarea,
select,
.chat-input-area input,
.file-input {
    width: 100%;
    border: 1px solid rgba(0, 77, 64, 0.16);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    color: var(--text);
    outline: none;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}

textarea {
    min-height: 128px;
    resize: vertical;
    padding: 16px 18px;
    font-size: 1rem;
    line-height: 2;
}

textarea::placeholder,
.chat-input-area input::placeholder {
    color: #9aa5a0;
}

textarea:focus,
select:focus,
.chat-input-area input:focus,
.file-input:focus {
    border-color: rgba(212, 175, 55, 0.9);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.18);
    background-color: #fffefa;
}

.filters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.filters select {
    min-height: 48px;
    padding: 0 14px;
    cursor: pointer;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

button {
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.75;
    transform: none;
}

.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    box-shadow: 0 14px 26px rgba(0, 77, 64, 0.24);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-dark));
    box-shadow: 0 18px 32px rgba(0, 77, 64, 0.30);
}

.btn-secondary {
    color: #2f2500;
    background: linear-gradient(135deg, #f3cf62, var(--secondary));
    box-shadow: 0 12px 22px rgba(173, 132, 36, 0.20);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #ffe08a, var(--secondary-dark));
}

.btn-ghost {
    color: var(--primary);
    background: rgba(0, 77, 64, 0.07);
    border: 1px solid rgba(0, 77, 64, 0.14);
}

.btn-ghost:hover {
    background: rgba(0, 77, 64, 0.11);
}

.full-width {
    width: 100%;
}

.metadata {
    margin: 16px 0 0;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(21, 94, 239, 0.08);
    color: var(--info);
    border: 1px solid rgba(21, 94, 239, 0.14);
    font-size: 0.9rem;
    font-weight: 700;
}

.error {
    display: none !important;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    max-width: 420px;
    padding: 14px 18px;
    border-radius: 18px;
    background: #fff1f0;
    color: #b42318;
    border: 1px solid rgba(180, 35, 24, 0.22);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.9;
    animation: toastIn 0.25s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.field-error {
    border-color: #b42318 !important;
    box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.12) !important;
}

.feature-layout {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 24px;
    align-items: stretch;
}

.feature-card {
    height: 100%;
}

.file-input {
    display: block;
    padding: 12px;
    margin: 8px 0 16px;
    background: #ffffff;
    cursor: pointer;
}

.file-input::file-selector-button {
    border: none;
    border-radius: 12px;
    padding: 9px 12px;
    margin-left: 12px;
    color: #ffffff;
    background: var(--primary);
    cursor: pointer;
    font-weight: 800;
}

.chat-box {
    height: 260px;
    overflow-y: auto;
    padding: 14px;
    margin-bottom: 14px;
    border-radius: var(--radius-md);
    background:
        linear-gradient(180deg, rgba(0, 77, 64, 0.04), rgba(212, 175, 55, 0.05)),
        #ffffff;
    border: 1px solid rgba(0, 77, 64, 0.12);
}

.chat-msg {
    width: fit-content;
    max-width: 82%;
    margin-bottom: 10px;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.94rem;
    line-height: 1.9;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
}

.msg-user {
    margin-right: auto;
    background: #e4f3ef;
    color: #143f38;
    border-bottom-right-radius: 5px;
}

.msg-bot {
    margin-left: auto;
    background: #fff6df;
    color: #4f3900;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-bottom-left-radius: 5px;
}

.chat-input-area {
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    min-height: 48px;
    padding: 0 14px;
}

.stream-card {
    border-color: rgba(212, 175, 55, 0.35);
    background:
        linear-gradient(135deg, rgba(255, 247, 223, 0.96), rgba(255, 253, 247, 0.96));
}

#stream-text {
    margin: 0;
    color: var(--text);
    white-space: pre-wrap;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 24px;
}

.recipe-card {
    position: relative;
    overflow: hidden;
    padding: 26px;
    border-radius: var(--radius-lg);
    background: rgba(255, 253, 247, 0.98);
    border: 1px solid rgba(0, 77, 64, 0.13);
    box-shadow: var(--shadow-md);
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.recipe-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 28px 55px rgba(0, 77, 64, 0.15);
    border-color: rgba(212, 175, 55, 0.45);
}

.recipe-card h3 {
    font-family: 'Lalezar', cursive;
    margin: 0 0 14px;
    padding-bottom: 12px;
    color: var(--primary);
    font-size: 1.75rem;
    font-weight: normal;
    line-height: 1.25;
    border-bottom: 1px solid rgba(0, 77, 64, 0.12);
}

.recipe-card p {
    margin: 12px 0;
    color: var(--text);
    font-size: 0.96rem;
}

.recipe-card p[style] {
    color: var(--danger) !important;
}

.recipe-card strong {
    color: var(--primary-dark);
}

.recipe-card hr {
    border: none;
    height: 1px;
    margin: 18px 0;
    background: rgba(0, 77, 64, 0.12);
}

.recipe-card h4 {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 1.05rem;
}

.recipe-card ul {
    padding-right: 20px;
    margin: 0;
}

.recipe-card li {
    margin-bottom: 8px;
    color: var(--text);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.tags span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0, 77, 64, 0.07);
    color: var(--primary);
    border: 1px solid rgba(0, 77, 64, 0.12);
    font-size: 0.82rem;
    font-weight: 800;
}

.recipe-card .metadata {
    margin-top: 18px;
    color: #725200;
    background: #fff6df;
    border-color: rgba(212, 175, 55, 0.28);
}

@media (max-width: 980px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .hero-copy {
        text-align: center;
    }

    .hero-subtitle {
        margin: 0 auto;
    }

    .api-badge {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-visual {
        max-width: 760px;
        margin: 0 auto;
    }

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

@media (max-width: 720px) {
    .hero {
        padding: 34px 14px 74px;
    }

    .hero-copy h1 {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 0.98rem;
        line-height: 2;
    }

    .hero-visual img {
        border-radius: 22px;
    }

    .container {
        margin-top: -36px;
        padding: 0 14px;
        gap: 20px;
    }

    .card,
    .recipe-card {
        border-radius: 20px;
        padding: 22px;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .actions {
        flex-direction: column;
    }

    .actions button {
        width: 100%;
    }

    .chat-input-area {
        flex-direction: column;
    }

    .chat-input-area button {
        width: 100%;
    }

    .api-badge {
        width: 100%;
        max-width: 360px;
    }

    .toast {
        right: 14px;
        left: 14px;
        bottom: 18px;
        max-width: none;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-copy h1 {
        font-size: 2.45rem;
    }

    .section-heading h2,
    .section-heading h3,
    .card h2 {
        font-size: 1.3rem;
    }

    textarea {
        min-height: 110px;
    }

    .chat-msg {
        max-width: 94%;
    }
}