/* ============================================================
   LENHART FARMS — Simplified Portal Stylesheet
   Mobile-first, accessible, large-text design
   ============================================================ */

:root {
    --green:        #2d6a4f;
    --green-dark:   #1b4332;
    --green-hover:  #245c42;
    --green-soft:   rgba(45, 106, 79, 0.10);
    --bg:           #f3f7f4;
    --white:        #ffffff;
    --text:         #1a1a1a;
    --text-muted:   #5a6a62;
    --border:       rgba(45, 106, 79, 0.12);
    --shadow:       0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(45, 106, 79, 0.18);
    --radius-card:  22px;
    --radius-btn:   14px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 17px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 24, 14, 0.93);
    z-index: 9999;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.loading-overlay.hidden { display: none !important; }

.loading-spinner {
    width: 68px;
    height: 68px;
    border: 5px solid rgba(82, 183, 136, 0.2);
    border-top-color: #52b788;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1.6rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-app-name {
    color: #d8f3dc;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.4rem;
    padding: 0 1.5rem;
}

.loading-wait {
    color: rgba(216, 243, 220, 0.5);
    font-size: 1rem;
    text-align: center;
}

/* ===== SITE HEADER ===== */
.site-header {
    background: var(--green);
    padding: 2rem 1.5rem 1.8rem;
    text-align: center;
}

.header-icon-wrap {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    color: white;
    margin: 0 auto 1rem;
}

.header-farm-name {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 0.3rem;
}

.header-portal-label {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
    max-width: 880px;
    margin: 0 auto;
    padding: 2.2rem 1.2rem 1.5rem;
}

/* ===== WELCOME ===== */
.welcome-section {
    text-align: center;
    margin-bottom: 2.2rem;
}

.welcome-heading {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.45rem;
    line-height: 1.3;
}

.welcome-sub {
    font-size: 1.05rem;
    color: var(--text-muted);
}

/* ===== APPLICATION TILES ===== */
.apps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.4rem;
}

.app-tile {
    background: var(--white);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    padding: 2.2rem 1.8rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: box-shadow 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
}

.app-tile:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
    border-color: var(--border);
}

/* Large app icon */
.app-icon {
    width: 88px;
    height: 88px;
    background: var(--green-soft);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    color: var(--green);
    margin-bottom: 1.4rem;
    flex-shrink: 0;
}

/* App title */
.app-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.55rem;
    line-height: 1.25;
}

/* App description */
.app-desc {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.8rem;
    line-height: 1.6;
    max-width: 300px;
}

/* Open button */
.btn-open {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 1rem 1.5rem;
    background: var(--green);
    color: white;
    border: none;
    border-radius: var(--radius-btn);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 58px;
    transition: background 0.18s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: 0.1px;
}

.btn-open:hover  { background: var(--green-hover); }
.btn-open:active { transform: scale(0.98); background: var(--green-dark); }

.btn-open .btn-arrow {
    font-size: 0.9rem;
    transition: transform 0.18s ease;
}

.btn-open:hover .btn-arrow { transform: translateX(4px); }

/* ===== FOOTER ===== */
.site-footer {
    text-align: center;
    padding: 1.4rem 1rem;
    font-size: 0.88rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--white);
    margin-top: 0.5rem;
}

/* ===== TABLET: side-by-side tiles ===== */
@media (min-width: 640px) {
    .main-wrapper {
        padding: 2.8rem 1.5rem 2rem;
    }

    .apps-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.6rem;
    }

    .welcome-heading {
        font-size: 1.75rem;
    }
}

/* ===== DESKTOP ===== */
@media (min-width: 900px) {
    .main-wrapper {
        padding: 3.5rem 2rem 2.5rem;
    }

    .site-header {
        padding: 2.4rem 2rem 2.2rem;
    }

    .header-farm-name {
        font-size: 2.4rem;
    }

    .header-portal-label {
        font-size: 1rem;
    }

    .welcome-heading {
        font-size: 2rem;
    }

    .welcome-sub {
        font-size: 1.1rem;
    }

    .app-icon {
        width: 100px;
        height: 100px;
        font-size: 2.7rem;
        border-radius: 26px;
    }

    .app-name {
        font-size: 1.65rem;
    }

    .app-desc {
        font-size: 1.05rem;
    }

    .btn-open {
        font-size: 1.15rem;
        min-height: 62px;
    }
}

/* ===== VERY SMALL SCREENS ===== */
@media (max-width: 380px) {
    html { font-size: 16px; }

    .header-farm-name     { font-size: 1.7rem; }
    .welcome-heading      { font-size: 1.35rem; }
    .app-tile             { padding: 1.8rem 1.4rem 1.6rem; }
    .app-icon             { width: 76px; height: 76px; font-size: 2rem; }
    .app-name             { font-size: 1.35rem; }
    .btn-open             { font-size: 1rem; min-height: 54px; }
}
