:root {
    --bg1: #fff4dc;
    --bg2: #edf6ff;
    --dark: #121a2f;
    --muted: #667085;
    --primary: #ffad2f;
    --primary2: #ffcc5c;
    --border: rgba(18, 26, 47, .12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 173, 47, .28), transparent 34%),
        linear-gradient(135deg, var(--bg1), var(--bg2));
    color: var(--dark);
}

.page-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 14px;
}

.hero-card {
    width: min(920px, 100%);
    background: rgba(255,255,255,.94);
    border-radius: 30px;
    border: 1px solid var(--border);
    padding: clamp(24px, 5vw, 48px);
    box-shadow: 0 28px 90px rgba(18, 26, 47, .16);
    text-align: center;
}

.brand-mark {
    width: 84px;
    height: 84px;
    border-radius: 26px;
    margin: 0 auto 22px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary2), var(--primary));
    color: #121a2f;
    font-size: 42px;
    font-weight: 900;
    box-shadow: 0 16px 34px rgba(255, 173, 47, .34);
}

h1 {
    margin: 0;
    font-size: clamp(42px, 7vw, 72px);
    letter-spacing: -2px;
    font-weight: 900;
}

.subtitle {
    max-width: 720px;
    margin: 14px auto 0;
    color: var(--muted);
    font-size: clamp(17px, 2.3vw, 22px);
    line-height: 1.55;
}

.notice {
    margin: 28px auto 0;
    max-width: 760px;
    padding: 15px 18px;
    border-radius: 18px;
    background: #fff3cd;
    color: #5c4200;
    border: 1px solid rgba(255, 173, 47, .36);
    font-weight: 700;
    line-height: 1.5;
}

.scan-form {
    margin-top: 30px;
    text-align: left;
}

.field-label {
    display: block;
    margin: 0 0 9px;
    font-size: 15px;
    font-weight: 800;
    color: #344054;
}

.file-input,
.select-input {
    width: 100%;
    border: 1px solid rgba(18, 26, 47, .18);
    border-radius: 16px;
    padding: 15px 16px;
    background: #fbfdff;
    color: var(--dark);
    font-size: 16px;
    outline: none;
}

.file-input:focus,
.select-input:focus {
    border-color: rgba(255, 173, 47, .9);
    box-shadow: 0 0 0 4px rgba(255, 173, 47, .18);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 18px;
}

.primary-btn {
    width: 100%;
    min-height: 58px;
    margin-top: 24px;
    border: none;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary2), var(--primary));
    color: #201400;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(255, 173, 47, .32);
}

.primary-btn:hover {
    filter: brightness(1.03);
}

.feature-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    text-align: center;
}

.feature-grid div {
    padding: 14px 10px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid var(--border);
    font-weight: 800;
    color: #344054;
}

.result-layout {
    width: min(1080px, 100%);
    background: rgba(255,255,255,.95);
    border-radius: 28px;
    border: 1px solid var(--border);
    padding: clamp(20px, 4vw, 38px);
    box-shadow: 0 28px 90px rgba(18, 26, 47, .16);
}

.result-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.result-header h1 {
    font-size: clamp(32px, 5vw, 52px);
}

.result-header p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 17px;
}

.result-textarea {
    width: 100%;
    min-height: 440px;
    margin-top: 22px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(18, 26, 47, .18);
    background: #fbfdff;
    color: #101828;
    font-size: 17px;
    line-height: 1.65;
    resize: vertical;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.action-btn,
.secondary-btn {
    min-height: 48px;
    padding: 0 20px;
    border-radius: 14px;
    border: none;
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-btn {
    background: linear-gradient(135deg, var(--primary2), var(--primary));
    color: #201400;
}

.secondary-btn {
    background: #121a2f;
    color: #fff;
}

.outline-btn {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid rgba(18, 26, 47, .22);
    color: #121a2f;
    text-decoration: none;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
}

.copy-status {
    min-height: 24px;
    margin-top: 10px;
    color: #137333;
    font-weight: 800;
}

.meta-note {
    margin-top: 16px;
    color: var(--muted);
    font-size: 14px;
}

.error-box {
    margin-top: 20px;
    padding: 16px;
    border-radius: 16px;
    background: #fff1f0;
    border: 1px solid #ffccc7;
    color: #a8071a;
    font-weight: 800;
}

@media (max-width: 760px) {
    .hero-card,
    .result-layout {
        border-radius: 24px;
    }

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

    .action-row,
    .action-row form,
    .action-row button,
    .action-row a {
        width: 100%;
    }
}

/* ===== TathyaSathi Crop UI ===== */
.crop-panel {
    display: none;
    margin-top: 20px;
    padding: 16px;
    border-radius: 22px;
    background: #f8fafc;
    border: 1px solid rgba(18, 26, 47, .12);
}

.crop-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.crop-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 900;
    color: #121a2f;
}

.crop-header p {
    margin: 6px 0 0;
    color: #667085;
    font-size: 15px;
    line-height: 1.45;
}

.crop-box {
    width: 100%;
    max-height: 68vh;
    overflow: hidden;
    border-radius: 18px;
    background: #101828;
    border: 1px solid rgba(18, 26, 47, .16);
}

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

.crop-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.mini-btn {
    min-height: 42px;
    border: none;
    border-radius: 12px;
    padding: 0 14px;
    background: #121a2f;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.cropper-view-box,
.cropper-face {
    border-radius: 4px;
}

@media (max-width: 760px) {
    .crop-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .mini-btn {
        width: 100%;
    }

    .crop-box {
        max-height: 62vh;
    }
}
