/* ==========================================================================
   LEMBAR GAYA (STYLESHEET) PADI VISION AI
   Desain modern bertema pertanian cerdas (Smart Agriculture),
   mendukung tampilan responsif ponsel/desktop dan prefers-reduced-motion.
   ========================================================================== */

:root {
            --forest: #102b1d;
            --forest-light: #173c29;
            --green: #287447;
            --emerald: #45a56b;
            --lime: #b5d88a;
            --gold: #e7bb52;
            --cream: #f7f8f0;
            --white: #ffffff;
            --text: #24372b;
            --muted: #829087;
            --border: #e7ede5;
            --shadow: 0 20px 60px rgba(16,43,29,.09);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html {
            scroll-behavior: smooth;
        }

        body {
            font-family: Inter, "Segoe UI", sans-serif;
            background: var(--cream);
            color: var(--text);
            line-height: 1.6;
        }

        button, input {
            font: inherit;
        }

        button {
            cursor: pointer;
        }

        a {
            text-decoration: none;
            color: inherit;
        }

        .container {
            width: min(1160px, calc(100% - 40px));
            margin: auto;
        }

        /* NAVBAR */

        .navbar {
            position: sticky;
            top: 0;
            z-index: 100;
            background: rgba(247,248,240,.88);
            backdrop-filter: blur(18px);
            border-bottom: 1px solid rgba(220,230,218,.8);
        }

        .nav-inner {
            height: 78px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .brand {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 21px;
            font-weight: 850;
            letter-spacing: -.8px;
            color: var(--forest);
        }

        .brand-icon {
            width: 44px;
            height: 44px;
            display: grid;
            place-items: center;
            background: linear-gradient(145deg,#286e43,#102b1d);
            border-radius: 14px;
            color: var(--gold);
            font-size: 24px;
            box-shadow: 0 5px 15px rgba(16,43,29,.2);
        }

        .brand span span {
            color: var(--green);
        }

        .nav-links {
            display: flex;
            gap: 35px;
            align-items: center;
            font-size: 13px;
            font-weight: 650;
            color: #66766b;
        }

        .nav-links a {
            transition: .2s;
        }

        .nav-links a:hover {
            color: var(--green);
        }

        .nav-cta {
            padding: 12px 20px;
            background: var(--forest);
            color: white;
            border-radius: 11px;
            font-size: 13px;
            font-weight: 750;
            transition: .25s;
        }

        .nav-cta:hover {
            background: var(--green);
            transform: translateY(-2px);
        }

        /* HERO */

        .hero {
            position: relative;
            overflow: hidden;
            padding: 90px 0 110px;
            background:
                radial-gradient(circle at 85% 20%,rgba(231,187,82,.20),transparent 27%),
                radial-gradient(circle at 5% 90%,rgba(69,165,107,.13),transparent 35%),
                linear-gradient(135deg,#f7f8f0,#edf5e9);
        }

        .hero::before {
            content: "";
            position: absolute;
            width: 480px;
            height: 480px;
            border: 1px solid rgba(40,116,71,.12);
            border-radius: 50%;
            right: -180px;
            top: -230px;
        }

        .hero-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            align-items: center;
            gap: 65px;
            position: relative;
            z-index: 1;
        }

        .eyebrow {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 8px 14px;
            background: #e5f1e3;
            border: 1px solid #d5e8d2;
            border-radius: 50px;
            color: var(--green);
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 1px;
            text-transform: uppercase;
        }

        .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #49a86b;
            box-shadow: 0 0 0 4px rgba(73,168,107,.15);
        }

        h1 {
            margin: 25px 0 20px;
            max-width: 600px;
            font-size: clamp(42px,5vw,65px);
            line-height: 1.08;
            letter-spacing: -3px;
            color: var(--forest);
        }

        h1 span {
            color: var(--green);
        }

        .hero-description {
            max-width: 490px;
            color: #6c7c70;
            font-size: 15px;
            line-height: 1.9;
        }

        .hero-actions {
            display: flex;
            gap: 13px;
            flex-wrap: wrap;
            margin-top: 30px;
        }

        .btn-primary,
        .btn-secondary {
            min-height: 51px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            padding: 0 23px;
            border-radius: 12px;
            font-size: 13px;
            font-weight: 750;
            transition: .25s;
        }

        .btn-primary {
            border: none;
            color: white;
            background: var(--forest);
            box-shadow: 0 8px 22px rgba(16,43,29,.18);
        }

        .btn-primary:hover {
            background: var(--green);
            transform: translateY(-2px);
        }

        .btn-secondary {
            color: var(--forest);
            background: white;
            border: 1px solid var(--border);
        }

        .btn-secondary:hover {
            border-color: var(--emerald);
            background: #f6fbf5;
        }

        .hero-note {
            margin-top: 25px;
            color: var(--muted);
            font-size: 12px;
            display: flex;
            gap: 9px;
            align-items: center;
        }

        .hero-note span {
            color: var(--green);
            font-weight: 900;
        }

        /* HERO VISUAL */

        .hero-visual {
            min-height: 420px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .field-art {
            width: 100%;
            max-width: 480px;
            height: 390px;
            position: relative;
            overflow: hidden;
            border: 6px solid white;
            border-radius: 30px;
            background: linear-gradient(180deg,#e9e8bb 0%,#b5d48c 50%,#477f4b 100%);
            box-shadow: 0 30px 70px rgba(16,43,29,.2);
        }

        .sun {
            position: absolute;
            top: 45px;
            right: 65px;
            width: 75px;
            height: 75px;
            border-radius: 50%;
            background: #ffe7a0;
            box-shadow: 0 0 55px rgba(255,231,160,.7);
        }

        .hill {
            position: absolute;
            width: 150%;
            height: 190px;
            left: -25%;
            bottom: 100px;
            background: #9fc47b;
            border-radius: 50% 50% 0 0;
            transform: rotate(-8deg);
        }

        .hill-two {
            position: absolute;
            width: 150%;
            height: 180px;
            left: -10%;
            bottom: 30px;
            background: #4c9250;
            border-radius: 50% 50% 0 0;
            transform: rotate(8deg);
        }

        .rice-lines {
            position: absolute;
            inset: 190px -20px -90px;
            transform: perspective(220px) rotateX(22deg);
            background: repeating-linear-gradient(
                165deg,
                transparent 0 17px,
                rgba(224,244,168,.55) 18px 21px,
                transparent 22px 38px
            );
        }

        .leaf {
            position: absolute;
            bottom: 10px;
            left: 43%;
            width: 11px;
            height: 170px;
            background: linear-gradient(90deg,#1c5d34,#8ec16b);
            border-radius: 100% 0 100% 0;
            transform: rotate(-19deg);
            z-index: 3;
        }

        .leaf::before,
        .leaf::after {
            content: "";
            position: absolute;
            width: 10px;
            height: 108px;
            bottom: 40px;
            background: linear-gradient(90deg,#276b39,#b5d87b);
            border-radius: 100% 0 100% 0;
            transform: rotate(24deg);
        }

        .leaf::after {
            height: 88px;
            bottom: 75px;
            transform: rotate(-35deg);
        }

        .scan-line {
            position: absolute;
            z-index: 4;
            left: 0;
            right: 0;
            height: 2px;
            background: #00e676;
            box-shadow: 0 0 15px #00e676;
            animation: scanning 4s ease-in-out infinite;
        }

        @keyframes scanning {
            0%,100% { top: 15%; opacity: 0; }
            15%,85% { opacity: 1; }
            50% { top: 80%; }
        }

        .scan-card,
        .detected-card {
            position: absolute;
            z-index: 5;
            background: rgba(255,255,255,.95);
            box-shadow: 0 12px 30px rgba(16,43,29,.16);
            backdrop-filter: blur(12px);
        }

        .scan-card {
            top: 22px;
            left: 20px;
            padding: 13px 16px;
            border-radius: 15px;
            display: flex;
            gap: 12px;
            align-items: center;
        }

        .scan-icon {
            width: 40px;
            height: 40px;
            display: grid;
            place-items: center;
            border-radius: 12px;
            background: #e6f3e4;
            font-size: 20px;
        }

        .scan-card strong,
        .scan-card small {
            display: block;
        }

        .scan-card strong {
            color: var(--forest);
            font-size: 12px;
        }

        .scan-card small {
            color: var(--muted);
            font-size: 10px;
        }

        .detected-card {
            bottom: 22px;
            right: 20px;
            padding: 14px 17px;
            border-left: 4px solid var(--gold);
            border-radius: 13px;
            min-width: 190px;
        }

        .detected-card small {
            color: var(--muted);
            font-size: 10px;
        }

        .detected-card strong {
            display: block;
            margin: 4px 0;
            color: var(--forest);
            font-size: 16px;
        }

        /* FEATURES */

        .features {
            padding: 90px 0;
            background: white;
        }

        .section-heading {
            text-align: center;
            max-width: 650px;
            margin: auto auto 40px;
        }

        .section-label {
            color: #b08b32;
            font-size: 11px;
            font-weight: 850;
            letter-spacing: 2px;
            text-transform: uppercase;
        }

        h2 {
            margin-top: 12px;
            color: var(--forest);
            font-size: clamp(28px,3vw,39px);
            line-height: 1.2;
            letter-spacing: -1.2px;
        }

        .section-heading p {
            margin-top: 13px;
            color: var(--muted);
            font-size: 14px;
        }

        .feature-grid {
            display: grid;
            grid-template-columns: repeat(3,1fr);
            gap: 22px;
        }

        .feature-card {
            padding: 29px;
            background: #fbfcf9;
            border: 1px solid var(--border);
            border-radius: 20px;
            transition: .3s;
        }

        .feature-card:hover {
            transform: translateY(-6px);
            border-color: #c8ddc7;
            box-shadow: var(--shadow);
        }

        .feature-icon {
            width: 53px;
            height: 53px;
            display: grid;
            place-items: center;
            border-radius: 16px;
            background: #e7f2e5;
            font-size: 24px;
        }

        .feature-card h3 {
            margin-top: 20px;
            color: var(--forest);
            font-size: 17px;
        }

        .feature-card p {
            margin-top: 9px;
            color: var(--muted);
            font-size: 13px;
            line-height: 1.8;
        }

        /* DETECTION */

        .detection {
            padding: 90px 0;
            background:
                radial-gradient(circle at 10% 10%,rgba(69,165,107,.09),transparent 35%),
                #f0f5ed;
            scroll-margin-top: 85px;
        }

        .detection-layout {
            display: grid;
            grid-template-columns: .8fr 1.2fr;
            gap: 45px;
            align-items: start;
        }

        .detection-intro {
            padding-top: 20px;
        }

        .detection-intro p {
            margin-top: 16px;
            color: #6b7d70;
            font-size: 14px;
            line-height: 1.9;
        }

        .steps {
            display: grid;
            gap: 21px;
            margin-top: 30px;
        }

        .step {
            display: flex;
            gap: 14px;
            align-items: flex-start;
        }

        .step-number {
            flex-shrink: 0;
            width: 38px;
            height: 38px;
            display: grid;
            place-items: center;
            border-radius: 12px;
            background: var(--forest);
            color: var(--gold);
            font-size: 12px;
            font-weight: 850;
        }

        .step strong {
            display: block;
            color: var(--forest);
            font-size: 13px;
        }

        .step small {
            display: block;
            margin-top: 4px;
            color: var(--muted);
            font-size: 12px;
        }

        /* UPLOAD PANEL */

        .upload-panel {
            padding: 29px;
            border: 1px solid #e3eae0;
            border-radius: 23px;
            background: white;
            box-shadow: var(--shadow);
        }

        .panel-heading {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            margin-bottom: 22px;
        }

        .panel-heading h3 {
            color: var(--forest);
            font-size: 18px;
        }

        .ai-badge {
            padding: 6px 11px;
            border-radius: 50px;
            background: #e8f3e4;
            color: var(--green);
            font-size: 10px;
            font-weight: 850;
        }

        .drop-zone {
            min-height: 230px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
            padding: 25px;
            border: 2px dashed #bfd4bb;
            border-radius: 18px;
            background: linear-gradient(180deg,#fbfdf9,#f3f8ef);
            transition: .25s;
        }

        .drop-zone.dragging {
            border-color: var(--green);
            background: #e5f3e1;
            transform: scale(1.01);
        }

        .upload-icon {
            width: 61px;
            height: 61px;
            display: grid;
            place-items: center;
            margin-bottom: 15px;
            border-radius: 18px;
            background: var(--forest);
            color: var(--gold);
            font-size: 27px;
        }

        .drop-zone strong {
            color: var(--forest);
            font-size: 14px;
        }

        .drop-zone p {
            margin-top: 6px;
            color: var(--muted);
            font-size: 12px;
        }

        .browse-button {
            margin-top: 17px;
            padding: 11px 19px;
            border: 1px solid #d9e5d5;
            border-radius: 10px;
            background: white;
            color: var(--green);
            font-size: 12px;
            font-weight: 800;
        }

        .browse-button:hover {
            background: #e9f3e6;
        }

        #uploadInput {
            display: none;
        }

        /* PREVIEW */

        .preview-wrap {
            display: none;
            margin-top: 18px;
            padding: 13px;
            border: 1px solid var(--border);
            border-radius: 16px;
            background: #fafcf9;
        }

        .preview-wrap.visible {
            display: block;
        }

        .preview-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 10px;
            margin-bottom: 12px;
            font-size: 12px;
        }

        #fileName {
            overflow-wrap: anywhere;
            color: var(--forest);
            font-weight: 750;
        }

        .remove-button {
            flex-shrink: 0;
            border: none;
            background: none;
            color: #c14e4e;
            font-size: 12px;
            font-weight: 750;
        }

        #previewImage {
            width: 100%;
            max-height: 280px;
            display: block;
            object-fit: contain;
            border-radius: 11px;
            background: #edf2ea;
        }

        /* ACTION BUTTONS */

        .action-row {
            display: flex;
            gap: 11px;
            margin-top: 18px;
        }

        .action-row .btn-primary {
            flex: 1;
        }

        .action-row .btn-secondary {
            min-height: 49px;
        }

        .btn-primary:disabled {
            opacity: .5;
            cursor: not-allowed;
            transform: none;
        }

        /* MESSAGE */

        .message {
            display: none;
            margin-top: 16px;
            padding: 13px 15px;
            border-radius: 11px;
            font-size: 12px;
            overflow-wrap: anywhere;
        }

        .message.visible {
            display: block;
        }

        .message.info {
            color: #285b83;
            background: #eaf4fb;
        }

        .message.error {
            color: #963b3b;
            background: #fff0ef;
        }

        .message.success {
            color: #28613b;
            background: #eaf6e9;
        }

        /* RESULT */

        .result-section {
            display: none;
            margin-top: 26px;
            padding-top: 23px;
            border-top: 1px solid var(--border);
        }

        .result-section.visible {
            display: block;
        }

        .result-section h4 {
            margin-bottom: 14px;
            color: var(--forest);
            font-size: 16px;
        }

        #resultCanvas {
            width: 100%;
            height: auto;
            display: block;
            max-height: 560px;
            object-fit: contain;
            border-radius: 13px;
            background: #edf2ea;
        }

        .result-note {
            margin-top: 11px;
            color: var(--muted);
            font-size: 11px;
        }

        /* RINGKASAN DETEKSI & LEGENDA KELAS (PENINGKATAN TAHAP 3) */

        .detection-summary {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 16px;
            align-items: center;
        }

        .summary-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 13px;
            font-weight: 600;
            color: white;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
        }

        .summary-badge .badge-count {
            background: rgba(255, 255, 255, 0.3);
            padding: 2px 7px;
            border-radius: 10px;
            font-size: 11px;
        }

        .empty-state-notice {
            background: #e8f5e9;
            border: 1px solid #c8e6c9;
            color: #2e7d32;
            padding: 14px 18px;
            border-radius: 12px;
            margin-top: 14px;
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 14px;
            font-weight: 500;
        }

        .empty-state-notice .empty-icon {
            font-size: 22px;
        }

        .class-legend {
            margin-top: 20px;
            padding: 14px 16px;
            background: #f1f5ee;
            border-radius: 12px;
            border: 1px solid var(--border);
        }

        .class-legend-title {
            font-size: 12px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--muted);
            margin-bottom: 10px;
        }

        .legend-items {
            display: flex;
            flex-wrap: wrap;
            gap: 14px;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            font-weight: 600;
            color: var(--text);
        }

        .legend-color {
            width: 14px;
            height: 14px;
            border-radius: 4px;
            display: inline-block;
            box-shadow: 0 1px 3px rgba(0,0,0,0.2);
        }

        /* FOOTER */

        footer {
            padding: 30px 0;
            background: var(--forest);
            color: #d6e5d6;
            border-top: 4px solid var(--gold);
        }

        .footer-inner {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 20px;
            font-size: 12px;
        }

        .footer-inner strong {
            color: white;
        }

        .footer-inner strong span {
            color: var(--gold);
        }

        /* RESPONSIVE */

        @media(max-width:850px) {
            .hero-grid {
                grid-template-columns: 1fr;
                gap: 35px;
            }

            .detection-layout {
                grid-template-columns: 1fr;
                gap: 30px;
            }

            .feature-grid {
                grid-template-columns: 1fr;
            }

            .hero-visual {
                min-height: 350px;
            }

            .field-art {
                max-width: 550px;
            }
        }

        @media(max-width:560px) {
            .container {
                width: calc(100% - 28px);
            }

            .nav-inner {
                height: 68px;
            }

            .brand {
                font-size: 18px;
            }

            .brand-icon {
                width: 39px;
                height: 39px;
            }

            .nav-links {
                display: none;
            }

            .nav-cta {
                padding: 10px 13px;
                font-size: 11px;
            }

            .hero {
                padding: 55px 0 65px;
            }

            h1 {
                font-size: 43px;
                letter-spacing: -2px;
            }

            .hero-description {
                font-size: 14px;
            }

            .hero-actions a {
                flex: 1;
            }

            .hero-visual {
                min-height: 300px;
            }

            .field-art {
                height: 290px;
                border-radius: 23px;
            }

            .scan-card {
                top: 13px;
                left: 11px;
                padding: 10px;
            }

            .detected-card {
                bottom: 14px;
                right: 10px;
            }

            .features,
            .detection {
                padding: 60px 0;
            }

            .upload-panel {
                padding: 17px;
                border-radius: 18px;
            }

            .drop-zone {
                min-height: 190px;
            }

            .action-row {
                flex-direction: column;
            }

            .footer-inner {
                flex-direction: column;
                text-align: center;
            }
        }

        @media(prefers-reduced-motion: reduce) {
            *,
            *::before,
            *::after {
                scroll-behavior: auto !important;
                animation: none !important;
                transition: none !important;
            }
        }

        /* NON-RICE ALERT CARD */
        .non-rice-alert {
            display: flex;
            align-items: flex-start;
            gap: 14px;
            margin-top: 18px;
            padding: 16px 20px;
            border-radius: 12px;
            background: #fff8e1;
            border: 2px solid #ffb300;
            color: #5d4037;
            box-shadow: 0 6px 18px rgba(255, 179, 0, 0.15);
            animation: fadeInAlert 0.3s ease-in-out;
        }

        @keyframes fadeInAlert {
            from { opacity: 0; transform: translateY(-8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .non-rice-alert .alert-icon {
            font-size: 28px;
            line-height: 1;
            flex-shrink: 0;
        }

        .non-rice-alert .alert-body {
            flex: 1;
        }

        .non-rice-alert strong#nonRiceTitle {
            display: block;
            font-size: 15px;
            font-weight: 800;
            color: #b76e00;
            margin-bottom: 5px;
        }

        .non-rice-alert p#nonRiceMessage {
            font-size: 13px;
            line-height: 1.5;
            margin: 0 0 10px 0;
            color: #4e342e;
        }

        .non-rice-alert .alert-tips {
            font-size: 12px;
            line-height: 1.45;
            padding: 8px 12px;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.7);
            border-left: 3px solid #ffb300;
            color: #6d4c41;
        }
