/* =========================================================
   FarmNova AI — Global Public Styles
   style.css
   ========================================================= */

/* =========================================================
   1. ROOT / RESET
   ========================================================= */

:root {
    --font-primary: "Plus Jakarta Sans", sans-serif;

    --fn-green: #2f8f35;
    --fn-green-dark: #23752a;
    --fn-green-soft: #edf8ee;

    --fn-text: #202020;
    --fn-muted: #69716b;

    --fn-white: #ffffff;
    --fn-black: #111111;

    --fn-border: rgba(32, 32, 32, 0.08);
    --fn-border-green: rgba(47, 143, 53, 0.20);

    --fn-shadow: 0 12px 35px rgba(35, 117, 42, 0.10);
    --fn-shadow-hover: 0 18px 45px rgba(35, 117, 42, 0.16);

    --fn-radius-sm: 8px;
    --fn-radius-md: 14px;
    --fn-radius-lg: 20px;
    --fn-radius-xl: 28px;
    --fn-radius-pill: 999px;

    --fn-header-height: 88px;

    --fn-container-width: 1440px;

    --fn-transition-fast: 0.2s ease;
    --fn-transition: 0.3s ease;
    --fn-transition-slow: 0.45s ease;
}


/* =========================================================
   2. GLOBAL RESET
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    margin: 0;
    padding: 0;

    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;

    color: var(--fn-text);
    background: var(--fn-white);

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    overflow-x: hidden;
}

img,
svg,
video {
    display: block;
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}


/* =========================================================
   3. GLOBAL ACCESSIBILITY
   ========================================================= */

:focus-visible {
    outline: 3px solid rgba(47, 143, 53, 0.25);
    outline-offset: 3px;
}

::selection {
    background: rgba(47, 143, 53, 0.18);
    color: var(--fn-text);
}


/* =========================================================
   4. GLOBAL CONTAINER
   ========================================================= */

.fn-container {
    width: min(100% - 48px, var(--fn-container-width));
    margin-inline: auto;
}


/* =========================================================
   5. PUBLIC HEADER
   ========================================================= */

.fn-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    width: 100%;
    min-height: var(--fn-header-height);

    background: rgba(255, 255, 255, 0.94);

    border-bottom: 1px solid var(--fn-border);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    transition:
        background var(--fn-transition),
        box-shadow var(--fn-transition),
        border-color var(--fn-transition);
}


/* =========================================================
   HEADER CONTAINER
   ========================================================= */

.fn-header-container {
    width: min(100% - 48px, var(--fn-container-width));

    min-height: var(--fn-header-height);

    margin-inline: auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}


/* =========================================================
   BRAND
   ========================================================= */

.fn-brand {
    display: inline-flex;
    align-items: center;

    gap: 11px;

    flex-shrink: 0;

    color: var(--fn-text);

    text-decoration: none;

    transition:
        transform var(--fn-transition),
        opacity var(--fn-transition);
}

.fn-brand:hover {
    color: var(--fn-text);
    text-decoration: none;
    transform: translateY(-1px);
}
.fn-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.fn-brand-logo {
    width: 70px;
    height: auto;
    display: block;
    object-fit: contain;
}
.fn-brand-icon {
    width: 42px;
    height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 13px;

    background: var(--fn-green);

    color: var(--fn-white);

    font-size: 20px;

    box-shadow:
        0 8px 20px rgba(47, 143, 53, 0.18);
}

.fn-brand-text {
    display: flex;
    flex-direction: column;

    line-height: 1.05;

    white-space: nowrap;
}

.fn-brand-name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.fn-brand-tagline {
    margin-top: 4px;

    color: var(--fn-muted);

    font-size: 9px;
    font-weight: 600;

    letter-spacing: 0.8px;
    text-transform: uppercase;
}


/* =========================================================
   6. DESKTOP NAVIGATION
   ========================================================= */

.fn-nav {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 3px;

    flex: 1;
}

.fn-nav-link {
    position: relative;

    min-height: 44px;

    padding: 0 11px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: #4e554f;

    font-size: 14px;
    font-weight: 600;

    white-space: nowrap;

    transition:
        color var(--fn-transition),
        transform var(--fn-transition);
}

.fn-nav-link::after {
    content: "";

    position: absolute;

    left: 50%;
    bottom: 4px;

    width: 0;
    height: 2px;

    border-radius: 999px;

    background: var(--fn-green);

    transform: translateX(-50%);

    transition: width var(--fn-transition);
}

.fn-nav-link:hover {
    color: var(--fn-green-dark);
    transform: translateY(-1px);
}

.fn-nav-link:hover::after,
.fn-nav-link.active::after {
    width: calc(100% - 22px);
}

.fn-nav-link.active {
    color: var(--fn-green-dark);
    font-weight: 700;
}


/* =========================================================
   7. HEADER ACTIONS
   ========================================================= */

.fn-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 10px;

    flex-shrink: 0;
}


/* =========================================================
   CREATE ACCOUNT BUTTON
   ========================================================= */

.fn-register-btn {
    min-height: 48px;

    padding: 0 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    border: 1px solid rgba(47, 143, 53, 0.22);
    border-radius: var(--fn-radius-pill);

    background: var(--fn-green-soft);
    color: var(--fn-green);

    font-size: 14px;
    font-weight: 700;

    white-space: nowrap;

    transition:
        background var(--fn-transition),
        color var(--fn-transition),
        border-color var(--fn-transition),
        transform var(--fn-transition),
        box-shadow var(--fn-transition);
}

.fn-register-btn i {
    font-size: 15px;

    transition: transform var(--fn-transition);
}

.fn-register-btn:hover {
    background: #e1f3e3;

    border-color: rgba(47, 143, 53, 0.35);

    color: var(--fn-green-dark);

    text-decoration: none;

    transform: translateY(-2px);

    box-shadow:
        0 8px 20px rgba(47, 143, 53, 0.10);
}

.fn-register-btn:hover i {
    transform: translateY(-1px);
}

.fn-register-btn.active {
    background: var(--fn-green);
    border-color: var(--fn-green);

    color: var(--fn-white);

    box-shadow:
        0 8px 20px rgba(47, 143, 53, 0.16);
}

.fn-register-btn.active:hover {
    background: var(--fn-green-dark);
    border-color: var(--fn-green-dark);

    color: var(--fn-white);
}

.fn-register-btn:focus-visible {
    outline: 3px solid rgba(47, 143, 53, 0.18);
    outline-offset: 3px;
}


/* =========================================================
   ANALYZE MY FARM BUTTON
   ========================================================= */

.fn-analyze-btn {
    min-height: 48px;

    padding: 0 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    border: 1px solid var(--fn-green);
    border-radius: var(--fn-radius-pill);

    background: var(--fn-green);
    color: var(--fn-white);

    font-size: 14px;
    font-weight: 700;

    white-space: nowrap;

    box-shadow:
        0 7px 18px rgba(47, 143, 53, 0.14);

    transition:
        background var(--fn-transition),
        border-color var(--fn-transition),
        transform var(--fn-transition),
        box-shadow var(--fn-transition);
}

.fn-analyze-btn i {
    font-size: 15px;

    transition: transform var(--fn-transition);
}

.fn-analyze-btn:hover {
    background: var(--fn-green-dark);
    border-color: var(--fn-green-dark);

    color: var(--fn-white);

    transform: translateY(-2px);

    box-shadow:
        0 11px 25px rgba(47, 143, 53, 0.20);
}

.fn-analyze-btn:hover i {
    transform: translateX(2px);
}


/* =========================================================
   8. MOBILE MENU TOGGLE
   ========================================================= */

.fn-menu-toggle {
    width: 46px;
    height: 46px;

    display: none;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border: 1px solid var(--fn-border);
    border-radius: 12px;

    background: var(--fn-white);
    color: var(--fn-text);

    font-size: 21px;

    transition:
        background var(--fn-transition),
        color var(--fn-transition),
        border-color var(--fn-transition),
        transform var(--fn-transition);
}

.fn-menu-toggle:hover {
    background: var(--fn-green-soft);

    border-color: var(--fn-border-green);

    color: var(--fn-green);

    transform: translateY(-1px);
}


/* =========================================================
   9. MOBILE MENU
   ========================================================= */

.fn-mobile-menu {
    display: none;

    width: 100%;

    padding: 12px 24px 24px;

    background: rgba(255, 255, 255, 0.98);

    border-top: 1px solid var(--fn-border);

    box-shadow:
        0 18px 35px rgba(32, 32, 32, 0.08);
}

.fn-mobile-menu.show {
    display: block;
}

.fn-mobile-link {
    min-height: 52px;

    padding: 0 4px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--fn-border);

    color: #4e554f;

    font-size: 14px;
    font-weight: 600;

    transition:
        color var(--fn-transition),
        padding-left var(--fn-transition);
}

.fn-mobile-link span {
    display: inline-flex;
    align-items: center;

    gap: 10px;
}

.fn-mobile-link i {
    font-size: 17px;
}

.fn-mobile-link:hover {
    color: var(--fn-green);

    padding-left: 7px;
}

.fn-mobile-link.active {
    color: var(--fn-green);
    font-weight: 700;
}


/* =========================================================
   MOBILE REGISTER
   ========================================================= */

.fn-mobile-register {
    margin-top: 8px;

    border-top: 1px solid var(--fn-border);
    border-bottom: 0;

    color: var(--fn-green);

    font-weight: 700;
}

.fn-mobile-register:hover {
    color: var(--fn-green-dark);
}


/* =========================================================
   MOBILE ANALYZE BUTTON
   ========================================================= */

.fn-mobile-analyze {
    margin-top: 14px;

    min-height: 50px;

    padding: 0 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    border: 1px solid var(--fn-green);
    border-radius: var(--fn-radius-pill);

    background: var(--fn-green);
    color: var(--fn-white);

    font-size: 14px;
    font-weight: 700;

    transition:
        background var(--fn-transition),
        transform var(--fn-transition),
        box-shadow var(--fn-transition);
}

.fn-mobile-analyze:hover {
    background: var(--fn-green-dark);

    color: var(--fn-white);

    transform: translateY(-2px);

    box-shadow:
        0 10px 24px rgba(47, 143, 53, 0.18);
}


/* =========================================================
   10. MAIN APPLICATION AREA
   ========================================================= */

#farmNovaApp {
    position: relative;

    width: 100%;
    min-height: calc(100vh - var(--fn-header-height));

    overflow: hidden;
}


/* =========================================================
   11. AJAX PAGE TRANSITION SUPPORT
   ========================================================= */

.fn-page-loading {
    pointer-events: none;
    opacity: 0.55;

    transition: opacity var(--fn-transition);
}

.fn-page-error {
    min-height: 55vh;

    padding: 60px 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    text-align: center;
}

.fn-page-error > div {
    max-width: 500px;
}

.fn-page-error i {
    display: inline-flex;
    margin-bottom: 18px;

    color: var(--fn-green);

    font-size: 48px;
}

.fn-page-error h2 {
    margin-bottom: 10px;

    color: var(--fn-text);

    font-size: 26px;
    font-weight: 800;
}

.fn-page-error p {
    margin-bottom: 0;

    color: var(--fn-muted);

    font-size: 15px;
}


/* =========================================================
   12. GENERIC BUTTON UTILITIES
   ========================================================= */

.fn-btn {
    min-height: 48px;

    padding: 0 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    border-radius: var(--fn-radius-pill);

    font-size: 14px;
    font-weight: 700;

    transition:
        transform var(--fn-transition),
        background var(--fn-transition),
        color var(--fn-transition),
        border-color var(--fn-transition),
        box-shadow var(--fn-transition);
}

.fn-btn:hover {
    transform: translateY(-2px);
}

.fn-btn-primary {
    border: 1px solid var(--fn-green);

    background: var(--fn-green);
    color: var(--fn-white);

    box-shadow:
        0 8px 20px rgba(47, 143, 53, 0.14);
}

.fn-btn-primary:hover {
    background: var(--fn-green-dark);
    border-color: var(--fn-green-dark);

    color: var(--fn-white);

    box-shadow:
        0 12px 28px rgba(47, 143, 53, 0.20);
}

.fn-btn-secondary {
    border: 1px solid rgba(47, 143, 53, 0.20);

    background: var(--fn-green-soft);
    color: var(--fn-green);
}

.fn-btn-secondary:hover {
    background: #e1f3e3;

    border-color: rgba(47, 143, 53, 0.32);

    color: var(--fn-green-dark);
}


/* =========================================================
   13. TEXT UTILITIES
   ========================================================= */

.fn-text-green {
    color: var(--fn-green);
}

.fn-text-muted {
    color: var(--fn-muted);
}

.fn-text-center {
    text-align: center;
}


/* =========================================================
   14. RESPONSIVE — LARGE LAPTOPS
   ========================================================= */

@media (max-width: 1250px) {

    .fn-header-container {
        width: min(100% - 40px, var(--fn-container-width));
        gap: 14px;
    }

    .fn-nav {
        gap: 0;
    }

    .fn-nav-link {
        padding-inline: 9px;
        font-size: 13px;
    }

    .fn-nav-link:hover::after,
    .fn-nav-link.active::after {
        width: calc(100% - 18px);
    }

    .fn-register-btn,
    .fn-analyze-btn {
        min-height: 46px;
        padding-inline: 15px;

        font-size: 13px;
    }

    .fn-header-actions {
        gap: 7px;
    }
}


/* =========================================================
   15. RESPONSIVE — TABLETS / SMALL LAPTOPS
   ========================================================= */

@media (max-width: 1100px) {

    :root {
        --fn-header-height: 80px;
    }

    .fn-header-container {
        min-height: 80px;

        width: min(100% - 35px, var(--fn-container-width));
    }

    .fn-brand-icon {
        width: 40px;
        height: 40px;
    }

    .fn-brand-name {
        font-size: 16px;
    }

    .fn-nav-link {
        padding-inline: 7px;
        font-size: 12px;
    }

    .fn-register-btn,
    .fn-analyze-btn {
        min-height: 44px;
        padding-inline: 12px;

        font-size: 12px;
    }

    .fn-header-actions {
        gap: 6px;
    }
}


/* =========================================================
   16. RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 950px) {

    .fn-header-container {
        width: min(100% - 32px, var(--fn-container-width));
    }

    /*
     * Hide desktop navigation and show mobile controls.
     */
    .fn-nav {
        display: none;
    }

    .fn-header-actions {
        margin-left: auto;
    }

    .fn-register-btn,
    .fn-analyze-btn {
        display: none;
    }

    .fn-menu-toggle {
        display: inline-flex;
    }

    .fn-mobile-menu {
        padding-inline: 20px;
    }
}


/* =========================================================
   17. RESPONSIVE — LARGE PHONES
   ========================================================= */

@media (max-width: 768px) {

    html {
        scroll-padding-top: 85px;
    }

    body {
        font-size: 15px;
    }

    .fn-header-container {
        width: calc(100% - 28px);

        gap: 10px;
    }

    .fn-brand {
        gap: 9px;
    }

    .fn-brand-icon {
        width: 39px;
        height: 39px;

        border-radius: 11px;

        font-size: 18px;
    }

    .fn-brand-name {
        font-size: 15px;
    }

    .fn-brand-tagline {
        font-size: 8px;
        letter-spacing: 0.65px;
    }

    .fn-menu-toggle {
        width: 44px;
        height: 44px;
    }

    .fn-mobile-menu {
        padding: 10px 16px 20px;
    }

    .fn-mobile-link {
        min-height: 50px;

        font-size: 14px;
    }

    #farmNovaApp {
        min-height: calc(100vh - 80px);
    }

    .fn-container {
        width: calc(100% - 32px);
    }
}


/* =========================================================
   18. RESPONSIVE — SMALL PHONES
   ========================================================= */

@media (max-width: 480px) {

    :root {
        --fn-header-height: 74px;
    }

    .fn-header-container {
        width: calc(100% - 22px);

        min-height: 74px;
    }

    .fn-brand-icon {
        width: 37px;
        height: 37px;

        border-radius: 10px;

        font-size: 17px;
    }

    .fn-brand-name {
        font-size: 14px;
    }

    .fn-brand-tagline {
        display: none;
    }

    .fn-menu-toggle {
        width: 42px;
        height: 42px;

        border-radius: 11px;
    }

    .fn-mobile-menu {
        padding-inline: 12px;
    }

    .fn-mobile-link {
        min-height: 48px;

        font-size: 13px;
    }

    .fn-mobile-analyze {
        min-height: 48px;

        font-size: 13px;
    }

    .fn-container {
        width: calc(100% - 24px);
    }

    .fn-page-error {
        min-height: 60vh;

        padding-inline: 18px;
    }

    .fn-page-error h2 {
        font-size: 22px;
    }

    .fn-page-error p {
        font-size: 14px;
    }
}


/* =========================================================
   19. RESPONSIVE — VERY SMALL PHONES
   ========================================================= */

@media (max-width: 360px) {

    .fn-header-container {
        width: calc(100% - 18px);
    }

    .fn-brand {
        gap: 7px;
    }

    .fn-brand-icon {
        width: 35px;
        height: 35px;

        font-size: 16px;
    }

    .fn-brand-name {
        font-size: 13px;
    }

    .fn-menu-toggle {
        width: 40px;
        height: 40px;
    }

    .fn-mobile-menu {
        padding-inline: 10px;
    }
}


/* =========================================================
   20. TOUCH DEVICES
   ========================================================= */

@media (hover: none) and (pointer: coarse) {

    .fn-nav-link:hover,
    .fn-register-btn:hover,
    .fn-analyze-btn:hover,
    .fn-mobile-link:hover,
    .fn-mobile-analyze:hover,
    .fn-btn:hover {
        transform: none;
    }

    /*
     * Keep tap targets comfortable.
     */
    .fn-mobile-link {
        min-height: 52px;
    }

    .fn-mobile-analyze {
        min-height: 50px;
    }
}


/* =========================================================
   21. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}