/* ===================================================
   LuminaFarm - Modern Design System
   =================================================== */

/* --- Design Tokens --- */
:root {
    --primary: #2E7D32;
    --primary-light: #60ad5e;
    --primary-dark: #1B5E20;
    --primary-50: rgba(46, 125, 50, 0.08);
    --primary-100: rgba(46, 125, 50, 0.15);

    --secondary: #F9A825;
    --secondary-light: #ffd95a;
    --secondary-dark: #c17900;

    --accent: #EF6C00;
    --accent-light: #ff9d3f;
    --accent-dark: #b53d00;

    --surface: #ffffff;
    --surface-dim: #f5f7f5;
    --surface-container: #eef1ee;
    --surface-elevated: rgba(255, 255, 255, 0.85);

    --text-primary: #1a2e1c;
    --text-secondary: #5a6b5c;
    --text-tertiary: #8a9a8c;
    --text-on-primary: #ffffff;
    --text-on-secondary: #1a2e1c;

    --danger: #D32F2F;
    --danger-light: #ffcdd2;
    --success: #2E7D32;

    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    --nav-height: 130px;
    --nav-height-mobile: 90px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--surface-dim);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    margin-bottom: 0.75rem;
}

h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

p.lead {
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    color: var(--text-secondary);
}

/* --- Layout --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
}

.page-wrapper {
    min-height: 100vh;
    padding-top: calc(var(--nav-height) + 1rem);
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
}

@media (max-width: 767px) {
    .page-wrapper {
        padding-top: calc(var(--nav-height-mobile) + 0.5rem);
    }
}

/* --- Card / Glass Panel --- */
.glass-panel {
    background: var(--surface);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-panel:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
    outline: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-on-primary);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 16px rgba(46, 125, 50, 0.4);
    transform: translateY(-1px);
    color: white;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(46, 125, 50, 0.3);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text-on-secondary);
    border-color: var(--secondary);
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    border-color: var(--secondary-dark);
    color: white;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--text-on-primary);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: transparent;
    border: 2px solid var(--danger);
    color: var(--danger);
}

.btn-danger:hover {
    background-color: var(--danger);
    color: var(--text-on-primary);
    transform: translateY(-1px);
}

.btn-accent {
    background: var(--accent);
    color: var(--text-on-primary);
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(239, 108, 0, 0.3);
}

.btn-accent:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    box-shadow: 0 4px 16px rgba(239, 108, 0, 0.4);
    transform: translateY(-1px);
    color: white;
}

.btn-lg {
    padding: 1rem 2.25rem;
    font-size: 1.05rem;
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

/* --- Form Controls --- */
.form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-primary);
    background-color: var(--surface);
    border: 1.5px solid var(--surface-container);
    border-radius: var(--radius-xs);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    appearance: none;
}

.form-control:hover {
    border-color: var(--text-tertiary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-50);
    background-color: var(--surface);
}

.form-control:disabled {
    background-color: var(--surface-container);
    cursor: not-allowed;
    color: var(--text-tertiary);
    border-color: var(--surface-container);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a6b5c' d='M6 8.825L.35 3.175l.7-.7L6 7.425l4.95-4.95.7.7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.validation-message {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    cursor: pointer;
    accent-color: var(--primary);
    border-radius: 4px;
}

.checkbox-group label {
    cursor: pointer;
    user-select: none;
}

/* --- Grid System --- */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 767px) {

    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }

    .grid {
        gap: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .glass-panel {
        padding: 1.25rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-in {
    animation: fadeInUp 0.5s var(--transition-normal) both;
}

.animate-in-delay-1 {
    animation: fadeInUp 0.5s var(--transition-normal) 0.1s both;
}

.animate-in-delay-2 {
    animation: fadeInUp 0.5s var(--transition-normal) 0.2s both;
}

/* ===================================================
   Page-Specific Styles
   =================================================== */

/* --- Hero Section --- */
.hero-section {
    text-align: center;
    padding: clamp(3rem, 8vw, 6rem) 1.5rem;
    background: linear-gradient(165deg, #e8f5e9 0%, #f1f8e9 40%, var(--surface-dim) 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(46, 125, 50, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    color: var(--primary-dark);
    margin-bottom: 1.25rem;
}

.hero-section p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Feature / Value Cards --- */
.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    margin-bottom: 0.5rem;
}

.section-header p {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.feature-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.feature-card {
    background: var(--surface);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md);
    padding: 2rem;
    transition: all var(--transition-normal);
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-100);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    background: var(--primary-50);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1.25rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* --- Produce Cards --- */
.produce-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.produce-card-img {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.produce-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.produce-card:hover .produce-card-img img {
    transform: scale(1.05);
}

.produce-card-icon {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 2rem;
}

.produce-card-icon.egg {
    background: linear-gradient(135deg, #f5e6d3, #ecdcc8);
}

.produce-card-icon.meat {
    background: linear-gradient(135deg, #ffe0cc, #ffd4b8);
}

.produce-card h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.produce-card>p {
    text-align: center;
    font-size: 0.95rem;
}

.produce-card ul {
    list-style: none;
    margin: 1rem 0 1.5rem;
    padding: 0;
}

.produce-card ul li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.produce-card ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.35em;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-50);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%232E7D32' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
}

.produce-card .card-footer {
    margin-top: auto;
    padding-top: 0.5rem;
}

/* --- CAPTCHA Mock --- */
.captcha-container {
    background: #fafafa;
    border: 1.5px solid #e0e0e0;
    border-radius: var(--radius-xs);
    padding: 0.75rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    user-select: none;
    transition: border-color var(--transition-fast);
}

.captcha-container:hover {
    border-color: #bdbdbd;
}

.captcha-checkbox {
    width: 26px;
    height: 26px;
    border: 2px solid #c1c1c1;
    border-radius: 3px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--transition-fast);
    flex-shrink: 0;
}

.captcha-checkbox:hover {
    border-color: var(--primary);
}

.captcha-checkbox.checked {
    border-color: var(--primary);
    background: var(--primary-50);
}

.captcha-checkbox.checked::after {
    content: '';
    width: 12px;
    height: 18px;
    border-right: 3px solid var(--primary);
    border-bottom: 3px solid var(--primary);
    transform: rotate(45deg) translateY(-3px);
}

.captcha-text {
    font-family: 'Roboto', sans-serif;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.captcha-brand {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.captcha-brand-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.captcha-brand-text {
    font-size: 0.6rem;
    color: var(--text-tertiary);
}

/* --- Signup Form Specific --- */
.signup-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 1rem 3rem;
}

@media (min-width: 768px) {
    .signup-container {
        padding: 2rem 2rem 4rem;
    }
}

.signup-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.signup-header h1 {
    margin-bottom: 0.25rem;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.signup-header .lead {
    font-size: 0.95rem;
}

.signup-form-panel {
    padding: 1.25rem;
}

@media (min-width: 768px) {
    .signup-form-panel {
        padding: 2rem;
    }
}

.error-banner {
    background-color: var(--danger-light);
    color: var(--danger);
    padding: 0.65rem 1rem;
    border-radius: var(--radius-xs);
    margin-bottom: 1.25rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid rgba(211, 47, 47, 0.2);
}

.subscription-card {
    background: var(--surface-dim);
    padding: 1rem;
    border-radius: var(--radius-xs);
    border: 1.5px solid transparent;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.subscription-card:has(input:checked) {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-50);
}

.subscription-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    align-items: end;
    margin-top: 0.75rem;
}

.subscription-fields .form-label {
    white-space: nowrap;
    font-size: 0.8rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.form-actions .btn-primary {
    flex: 1;
}

@media (max-width: 767px) {
    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* --- Success Screen --- */
.success-screen {
    text-align: center;
    padding: 3rem 1.5rem;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-50);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem;
    animation: scaleIn 0.4s ease both;
}

.success-screen h2 {
    margin-bottom: 0.5rem;
}

.success-screen p {
    margin-bottom: 2rem;
}

/* --- Not Found Page --- */
.not-found {
    text-align: center;
    padding: 4rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.not-found-code {
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 800;
    color: var(--primary-50);
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--surface-container);
    -webkit-text-stroke: 2px var(--primary-light);
}

.not-found h2 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.not-found p {
    margin-bottom: 2rem;
}

/* --- Footer --- */
.site-footer {
    background: var(--text-primary);
    color: rgba(255, 255, 255, 0.7);
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand h4 {
    color: white;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
    max-width: 300px;
    margin-bottom: 0;
}

.footer-links h4 {
    color: white;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links ul li {
    margin-bottom: 0.4rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 767px) {
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* --- Utility Classes --- */
.text-center {
    text-align: center;
}

.text-primary-color {
    color: var(--primary);
}

.text-accent-color {
    color: var(--accent);
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* --- Accessibility --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

/* Override bootstrap link colors */
a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-dark);
}