/* =============================================
   DESIGN TOKENS — mirrors style.css exactly
   ============================================= */
:root {
    --green-900: #1b4332;
    --green-800: #2d6a4f;
    --green-700: #40916c;
    --green-600: #52b788;
    --green-500: #74c69d;
    --green-400: #95d5b2;
    --green-300: #b7e4c7;
    --green-200: #d8f3dc;
    --green-100: #f0fdf4;

    --gray-900: #1a202c;
    --gray-700: #4a5568;
    --gray-500: #a0aec0;
    --gray-200: #edf2f7;
    --gray-100: #f7fafc;
    --gray-50:  #fcfdfd;

    --font-sans:    'Plus Jakarta Sans', sans-serif;
    --font-serif:   'Source Sans 3', serif;
    --font-display: 'Poppins', sans-serif;

    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; }

html { overflow-y: scroll; scrollbar-gutter: stable; }

body {
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    background-color: var(--gray-50);
    color: var(--gray-700);
    line-height: 1.5;
    min-height: 100vh;
}

/* =============================================
   HEADER — identical to style.css
   ============================================= */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #e9efec;
    z-index: 1000;
    padding: 0.5rem 0;
}

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 56px;
    gap: 0;
    position: relative;
}

/* =============================================
   LOGO
   ============================================= */
.logo {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.logo img {
    height: 32px;
    width: 32px;
    border-radius: 50%;
}
.logo span {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--green-900);
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

/* =============================================
   NAV PILL — identical to style.css
   ============================================= */
nav {
    display: flex;
    gap: 0.2rem;
    align-items: center;
    padding: 0.26rem;
    border-radius: 999px;
    background: #f4f6f5;
    border: 1px solid #edf1ef;
}

nav a {
    font-weight: 600;
    color: #2f3e36;
    text-decoration: none;
    font-size: 0.88rem;
    position: relative;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    transition: color .2s ease, background-color .2s ease;
    width: max-content;
    display: inline-block;
}
nav a:hover {
    color: var(--green-900);
    background: #e9f2ed;
}
nav a::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0.25rem;
    width: 6px;
    height: 2px;
    background: #5a9a78;
    border-radius: 2px;
    transform: translateX(-50%) scaleX(0);
    transition: transform .24s ease;
}
nav a:hover::after,
nav a.active::after { transform: translateX(-50%) scaleX(1); }
nav a.active {
    background: #dfeee5;
    color: var(--green-900);
}

/* =============================================
   DROPDOWN — mirrors style.css
   ============================================= */
.dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.62rem);
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    color: var(--gray-700);
    box-shadow: 0 12px 24px rgba(19,50,36,.12);
    border-radius: 0.8rem;
    min-width: 190px;
    z-index: 1001;
    padding: 0.45rem 0;
    border: 1px solid #e8efea;
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color .2s ease;
    border-radius: 0;
    background: none;
}
.dropdown-menu a:hover {
    background-color: #edf4ef;
    color: var(--green-900);
}
.dropdown-menu a::after { display: none; }
.dropdown-menu a i {
    margin-right: 0.75rem;
    font-size: 1rem;
    width: 20px;
    text-align: center;
}
#scanPlant i.fa-chevron-down {
    margin-left: 0.3rem;
    font-size: 0.8rem;
    transition: transform .2s ease;
}
.dropdown:hover #scanPlant i.fa-chevron-down { transform: rotate(180deg); }

/* =============================================
   USER / PROFILE ICON (replaces auth-links)
   ============================================= */
.user-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--green-800);
    box-shadow: 0 4px 12px rgba(45,106,79,.25);
    cursor: pointer;
    flex-shrink: 0;
}
.user-icon a.profile {
    color: var(--green-200);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    text-decoration: none;
}
.user-icon a.profile::after { display: none !important; }

/* =============================================
   PROFILE SUB-MENU DROPDOWN
   ============================================= */
.sub-menu-wrap {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 1.5rem;
    width: min(92vw, 300px);
    max-height: 0;
    overflow: hidden;
    transition: max-height .45s ease;
    z-index: 1002;
}
.sub-menu-wrap.open-menu { max-height: 420px; }

.sub-menu {
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 1.1rem;
    box-shadow: 0 20px 44px rgba(17,66,23,.14);
    padding: 1.25rem;
    margin: 0.5rem 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 0.8rem;
}
.user-info img {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--green-600), var(--green-900));
    padding: 2px;
    object-fit: cover;
}
.user-info h2 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--green-900);
    margin: 0;
}
.sub-menu hr {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 0.75rem 0;
}

.sub-menu-link {
    align-items: baseline;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.sub-menu-link a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: var(--gray-700);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.6rem 0.75rem;
    border-radius: 0.65rem;
    transition: background .2s ease, color .2s ease;
    justify-content: space-between;
    background: none;
}
.sub-menu-link a:hover {
    background-color: #edf4ef;
    color: var(--green-900);
}
.sub-menu-link a::after { display: none !important; }
.sub-menu-link a i.same {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--green-600), var(--green-900));
    color: var(--green-100);
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-right: 0;
}
.sub-menu-link a span {
    margin-left: auto;
    font-size: 1rem;
    color: var(--gray-500);
    font-weight: 400;
}
.sub-menu-link-inner {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

/* =============================================
   MAIN HERO — matches style.css approach
   ============================================= */
main {
    padding-top: 72px;
    min-height: calc(100vh - 72px);
    background:
        linear-gradient(115deg, rgba(8,24,17,.74), rgba(19,53,39,.58)),
        url("bgimg.jpg") center center / cover no-repeat;
    display: flex;
    align-items: stretch;
    position: relative;
}
main img.bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 0;
    filter: saturate(1.05) contrast(1.03);
}
main::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, rgba(8,24,17,.74), rgba(19,53,39,.48));
    z-index: 1;
    pointer-events: none;
}

.hero-shell {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    max-width: 1240px;
    margin: 0 auto;
    padding: 2.2rem 2rem 1.6rem;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    max-width: 680px;
    padding: 0;
}

.hero-copy .eyebrow {
    font-size: 0.82rem;
    font-weight: 700;
    color: #d9f9e9;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.4rem 0.95rem;
    background-color: rgba(255,255,255,.13);
    border-radius: 99px;
    width: fit-content;
}

.hero-copy h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.2vw, 3.85rem);
    font-weight: 700;
    line-height: 1.12;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin: 0;
    max-width: 16ch;
    text-wrap: balance;
    text-shadow: 0 8px 24px rgba(0,0,0,.32);
}
.hero-copy p {
    font-size: clamp(1rem, 1.3vw, 1.18rem);
    line-height: 1.65;
    color: rgba(255,255,255,.92);
    max-width: 46ch;
    margin: 0;
    text-shadow: 0 4px 16px rgba(0,0,0,.24);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.45rem;
}
.hero-actions a {
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    padding: 0.9rem 1.5rem;
    border-radius: 99px;
    transition: all .2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
}
#scan {
    background-color: #ffffff;
    color: var(--green-900);
    border: 1px solid transparent;
}
#scan i { color: var(--green-900); }
#scan:hover { transform: translateY(-2px) scale(1.01); box-shadow: var(--shadow-lg); }

.hero-secondary {
    background-color: transparent;
    color: #ffffff;
    border: 1px solid rgba(255,255,255,.5);
}
.hero-secondary:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: var(--shadow-lg);
    border-color: #ffffff;
}

.hero-info {
    display: flex;
    gap: 2rem;
    font-weight: 500;
    color: rgba(255,255,255,.95);
    margin-top: 0.55rem;
    font-size: 0.95rem;
}

/* =============================================
   DASHBOARD GRID
   ============================================= */
.dashboard-grid {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.25fr 0.85fr;
    gap: 1.25rem;
    padding: 2rem 0 0;
    position: relative;
    z-index: 3;
    margin-top: -3.3rem;
}

.dashboard-card {
    padding: 1.75rem;
    border-radius: 1.5rem;
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,.7);
    box-shadow: 0 20px 44px rgba(17,66,23,.12);
}

.card-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(27,67,50,.1);
    color: var(--green-900);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.65rem;
}

.spotlight-card h2 {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2vw, 1.55rem);
    font-weight: 700;
    color: var(--green-900);
    margin: 0 0 0.55rem;
}
.spotlight-card > p {
    color: var(--gray-700);
    line-height: 1.65;
    margin: 0;
    font-size: 0.97rem;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}
.action-row a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    border-radius: 999px;
    padding: 0.78rem 1.35rem;
    font-weight: 700;
    font-size: 0.92rem;
    transition: all .2s ease;
    color: #ffffff;
    background: linear-gradient(135deg, var(--green-600) 0%, var(--green-900) 100%);
    box-shadow: 0 8px 20px rgba(27,67,50,.22);
}
.action-row a:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(27,67,50,.28); }
.action-row a::after { display: none !important; }

.secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    border-radius: 999px;
    padding: 0.78rem 1.35rem;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--green-900);
    background: rgba(27,67,50,.08);
    border: 1px solid rgba(27,67,50,.12);
    transition: all .2s ease;
}
.secondary-action:hover { background: rgba(27,67,50,.13); }

.metric-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 0.85rem;
    margin-top: 1.25rem;
}
.metric-box {
    padding: 1rem;
    border-radius: 1rem;
    background: var(--green-100);
    border: 1px solid var(--green-200);
    text-align: left;
}
.metric-box strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--green-900);
}
.metric-box span {
    font-size: 0.84rem;
    color: var(--green-800);
}

/* Profile card */
.profile-card h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--green-900);
    margin: 0 0 0.2rem;
}
.profile-card p {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin: 0;
}

.profile-header-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.1rem;
}
.profile-header-card img {
    width: 68px;
    height: 68px;
    border-radius: 1.1rem;
    object-fit: cover;
    padding: 2px;
    background: linear-gradient(135deg, var(--green-600), var(--green-900));
    box-shadow: 0 8px 18px rgba(27,67,50,.18);
}

.profile-highlights {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.65rem;
}
.profile-highlights li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 0.9rem;
    background: var(--green-100);
    border: 1px solid var(--green-200);
}
.profile-highlights span { color: var(--gray-500); font-size: 0.84rem; }
.profile-highlights strong { color: var(--green-900); font-size: 0.9rem; }

/* =============================================
   INSIGHT GRID — mirrors feature-strip
   ============================================= */
.insight-grid {
    width: min(1180px, calc(100% - 2rem));
    margin: 1.1rem auto 3rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 1rem;
    position: relative;
    z-index: 3;
}
.insight-card {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 1.1rem;
    border: 1px solid var(--gray-200);
    text-align: left;
    transition: all .3s ease;
    box-shadow: var(--shadow-sm);
}
.insight-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--green-300);
}
.insight-card i {
    font-size: 1.35rem;
    color: var(--green-100);
    margin-bottom: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--green-600), var(--green-900));
    border-radius: 14px;
}
.insight-card h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 0.5rem;
}
.insight-card p {
    font-size: 0.96rem;
    line-height: 1.6;
    color: var(--gray-700);
    margin: 0;
}

/* =============================================
   MODAL — mirrors style.css
   ============================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 1010;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,.6);
    justify-content: center;
    align-items: center;
}
.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    position: relative;
}
.modal-content h2 {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}
.close {
    position: absolute;
    top: 1rem; right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    transition: color .2s ease;
}
.close:hover { color: var(--gray-900); }

#drop-area {
    border: 2px dashed var(--green-400);
    border-radius: 0.75rem;
    padding: 3rem 2rem;
    text-align: center;
    background-color: var(--green-100);
    transition: all .2s ease;
    font-family: var(--font-sans);
    color: var(--green-800);
    font-size: 1.05rem;
    font-weight: 600;
    position: relative;
}
#drop-area:hover { background-color: var(--green-200); border-color: var(--green-600); }
#drop-area.dragover { background-color: var(--green-300); border-color: var(--green-700); }
#drop-area p { margin: 0.5rem 0; }
#fileInput { margin-top: 1rem; }

.predict-btn {
    margin-top: 1.2rem;
    padding: 0.75rem 2rem;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-sans);
    color: white;
    background: linear-gradient(135deg, var(--green-600) 0%, var(--green-900) 100%);
    border: none;
    border-radius: 99px;
    cursor: pointer;
    transition: all .2s ease;
    box-shadow: 0 8px 20px rgba(27,67,50,.22);
    display: inline-block;
    min-width: 160px;
}
.predict-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(27,67,50,.28); }

/* =============================================
   SIGNUP NAME MODAL
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(8,18,9,.4);
    backdrop-filter: blur(10px);
    display: none;
    z-index: 1009;
    opacity: 0;
    transition: opacity .4s ease;
}

.signup-container {
    display: none;
    position: fixed;
    z-index: 1010;
    right: clamp(1rem, 3vw, 3rem);
    bottom: clamp(1rem, 4vw, 3rem);
    width: min(92vw, 420px);
    padding: 2rem;
    border-radius: 1.5rem;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 60px rgba(17,66,23,.2);
    border: 1px solid rgba(255,255,255,.7);
    opacity: 0;
    transition: opacity .4s ease, transform .4s ease;
}

.signup-container .welcome-text {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 2.5vw, 1.75rem);
    font-weight: 700;
    color: var(--green-900);
    margin: 0 0 1.25rem;
}

.form-section { width: 100%; text-align: center; }
.header { margin-bottom: 0.5rem; }

.signup-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.form-group {
    width: 100%;
    text-align: left;
}
.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--green-900);
}
.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--green-300);
    border-radius: 0.65rem;
    background: var(--green-100);
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--gray-900);
    transition: all .2s ease;
    box-sizing: border-box;
}
.form-group input:focus {
    outline: none;
    border-color: var(--green-600);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(82,183,136,.2);
}
.form-group input::placeholder { color: var(--gray-500); }

.btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0.82rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-sans);
    color: white;
    background: linear-gradient(135deg, var(--green-600) 0%, var(--green-900) 100%);
    border: none;
    border-radius: 99px;
    cursor: pointer;
    transition: all .2s ease;
    box-shadow: 0 8px 20px rgba(27,67,50,.22);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(27,67,50,.28); }

/* =============================================
   WELCOME MESSAGE (typewriter)
   ============================================= */
.welcome-message {
    display: none;
    text-align: center;
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 12px 30px rgba(0,0,0,.3);
    z-index: 1011;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    transition: opacity .8s ease;
    letter-spacing: -0.02em;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1200px) {
    nav { display: none; }
}

@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .insight-grid   { grid-template-columns: 1fr; }
    .dashboard-grid { margin-top: -2rem; }
}

@media (max-width: 992px) {
    .hero-shell { justify-content: center; }
    .hero-copy { max-width: 100%; }
    .hero-info { flex-wrap: wrap; gap: 1rem 1.4rem; }
}

@media (max-width: 768px) {
    .hero-copy h1 { font-size: clamp(1.8rem, 9vw, 2.6rem); }
    .hero-actions { flex-direction: column; width: 100%; max-width: 320px; }
    .hero-actions a { width: 100%; justify-content: center; }
    .hero-info { flex-direction: column; gap: 0.8rem; }
    .metric-row { grid-template-columns: 1fr; }
    .insight-grid { grid-template-columns: 1fr; }
    .profile-highlights li { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .signup-container {
        right: 0.75rem;
        bottom: 0.75rem;
        width: calc(100vw - 1.5rem);
    }
}

