/* =============================================
   TERRALINK - ESTIL PRINCIPAL
   Agricultura Intel·ligent IoT
   ============================================= */

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

:root {
    --green-primary: #2ecc71;
    --green-dark: #27ae60;
    --green-light: #a8e6cf;
    --blue-primary: #3498db;
    --blue-dark: #2980b9;
    --blue-light: #d4e9f7;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --red: #e74c3c;
    --orange: #f39c12;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Poppins', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    margin-top: 70px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* --- NAVBAR --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--gray-900);
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-text-fallback {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.925rem;
    color: var(--gray-600);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--green-dark);
    background: var(--gray-100);
}

.nav-link.active {
    color: var(--green-dark);
    background: var(--green-light);
    font-weight: 600;
}

.nav-register {
    background: var(--green-primary) !important;
    color: #fff !important;
    padding: 10px 20px !important;
    border-radius: 25px !important;
    font-weight: 600 !important;
}

.nav-register:hover {
    background: var(--green-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(46,204,113,0.35);
}

.nav-logout {
    color: var(--red) !important;
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    width: 26px;
    height: 3px;
    background: var(--gray-700);
    border-radius: 3px;
    transition: var(--transition);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}
.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- HERO --- */
.hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #0f172a 0%, #1a3c34 30%, #1a4d3e 60%, #0f172a 100%);
    overflow: hidden;
    padding: 60px 24px;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(46,204,113,0.12) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 30%, rgba(52,152,219,0.1) 0%, transparent 50%);
    animation: heroBgFloat 15s ease-in-out infinite;
}

@keyframes heroBgFloat {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(20px, -15px); }
    66% { transform: translate(-15px, 10px); }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 750px;
}

.hero-badge {
    display: inline-block;
    background: rgba(46,204,113,0.2);
    color: var(--green-light);
    border: 1px solid rgba(46,204,113,0.35);
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.4rem, 5.5vw, 3.8rem);
    font-weight: 800;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 20px;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--green-primary), #58d68d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.75);
    margin-bottom: 36px;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 30px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    font-family: var(--font-body);
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--green-primary);
    color: #fff;
    box-shadow: 0 6px 25px rgba(46,204,113,0.35);
}

.btn-primary:hover {
    background: var(--green-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 35px rgba(46,204,113,0.45);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-3px);
}

.btn-outline {
    background: transparent;
    color: var(--green-dark);
    border: 2px solid var(--green-primary);
}

.btn-outline:hover {
    background: var(--green-primary);
    color: #fff;
}

.btn-sm {
    padding: 8px 18px;
    font-size: 0.85rem;
    border-radius: 20px;
}

/* --- SECTIONS --- */
.section {
    padding: 80px 24px;
}

.section-header {
    text-align: center;
    margin-bottom: 56px;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.section-header p {
    color: var(--gray-500);
    font-size: 1.05rem;
    max-width: 500px;
    margin: 0 auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* --- CARDS --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--green-primary), var(--blue-primary));
    opacity: 0;
    transition: var(--transition);
}

.card:hover::before {
    opacity: 1;
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 20px;
    background: var(--gray-100);
}

.card-icon.green {
    background: #e8f8f0;
    color: var(--green-dark);
}

.card-icon.blue {
    background: var(--blue-light);
    color: var(--blue-dark);
}

.card-icon.orange {
    background: #fef3e2;
    color: var(--orange);
}

.card h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--gray-900);
}

.card p {
    color: var(--gray-500);
    font-size: 0.925rem;
    line-height: 1.6;
}

/* --- STATS CARDS --- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-value.green { color: var(--green-dark); }
.stat-value.blue { color: var(--blue-dark); }
.stat-value.orange { color: var(--orange); }

.stat-label {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- TABLES --- */
.table-container {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--gray-50);
}

th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
}

td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.925rem;
    color: var(--gray-700);
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: var(--gray-50);
}

/* --- BADGES --- */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-success {
    background: #e8f8f0;
    color: var(--green-dark);
}

.badge-warning {
    background: #fef3e2;
    color: var(--orange);
}

.badge-danger {
    background: #fde8e8;
    color: var(--red);
}

.badge-info {
    background: var(--blue-light);
    color: var(--blue-dark);
}

/* --- FORMS --- */
.form-container {
    max-width: 480px;
    margin: 60px auto;
    background: var(--white);
    padding: 40px 36px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
}

.form-container h2 {
    font-family: var(--font-heading);
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--gray-900);
}

.form-container .form-subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 28px;
    font-size: 0.925rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 6px;
    color: var(--gray-700);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: var(--transition);
    background: var(--gray-50);
    color: var(--gray-800);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--green-primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(46,204,113,0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-error {
    background: #fde8e8;
    color: var(--red);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 16px;
    border-left: 4px solid var(--red);
}

.form-success {
    background: #e8f8f0;
    color: var(--green-dark);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 16px;
    border-left: 4px solid var(--green-primary);
}

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

.form-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--gray-500);
}

.form-footer a {
    color: var(--green-dark);
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* --- DASHBOARD LAYOUT --- */
.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 70px);
}

.sidebar {
    width: 250px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    padding: 20px 0;
    position: fixed;
    top: 70px;
    left: 0;
    height: calc(100vh - 70px);
    overflow-y: auto;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
}

.sidebar-menu {
    padding: 12px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    font-weight: 500;
    color: var(--gray-600);
    transition: var(--transition);
    font-size: 0.925rem;
}

.sidebar-link:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.sidebar-link.active {
    background: #e8f8f0;
    color: var(--green-dark);
    font-weight: 600;
    border-right: 3px solid var(--green-primary);
}

.sidebar-icon {
    font-size: 1.2rem;
}

.sidebar-logout {
    color: var(--red) !important;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    font-size: 0.8rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: var(--green-primary);
    box-shadow: 0 0 8px rgba(46,204,113,0.5);
}

.status-dot.offline {
    background: var(--red);
    box-shadow: 0 0 8px rgba(231,76,60,0.5);
}

.dashboard-content {
    flex: 1;
    margin-left: 250px;
    padding: 30px;
}

/* --- SENSOR / ACTUATOR CARDS --- */
.sensor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.sensor-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

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

.sensor-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.sensor-card-header h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
}

.sensor-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.sensor-value span {
    font-size: 1rem;
    color: var(--gray-500);
    font-weight: 400;
}

.sensor-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

.sensor-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.actuator-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    background: var(--gray-300);
    border-radius: 14px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.toggle-switch.active {
    background: var(--green-primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.toggle-switch.active::after {
    left: 27px;
}

/* --- ALERT BANNER --- */
.alert-banner {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 0.9rem;
}

.alert-info {
    background: var(--blue-light);
    color: var(--blue-dark);
    border-left: 4px solid var(--blue-primary);
}

.alert-warning {
    background: #fef3e2;
    color: #b45309;
    border-left: 4px solid var(--orange);
}

/* --- PAGE HEADER --- */
.page-header {
    background: linear-gradient(135deg, var(--gray-900), #1a3c34);
    padding: 60px 24px;
    text-align: center;
    color: #fff;
}

.page-header h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header p {
    color: rgba(255,255,255,0.7);
    font-size: 1.05rem;
}

/* --- BLOG CARDS --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.blog-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

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

.blog-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #a8e6cf, #d4e9f7);
}

.blog-card-body {
    padding: 20px 24px;
}

.blog-card-body .date {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-bottom: 6px;
}

.blog-card-body h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    margin-bottom: 8px;
}

.blog-card-body p {
    color: var(--gray-500);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* --- FOOTER --- */
.footer {
    background: var(--gray-900);
    color: rgba(255,255,255,0.7);
    padding: 60px 24px 30px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3,
.footer-col h4 {
    color: #fff;
    margin-bottom: 16px;
    font-family: var(--font-heading);
}

.footer-col h3 {
    font-size: 1.3rem;
}

.footer-col h4 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-col p {
    font-size: 0.9rem;
    line-height: 1.7;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: rgba(255,255,255,0.6);
    transition: var(--transition);
    font-size: 0.9rem;
}

.footer-col ul li a:hover {
    color: var(--green-primary);
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--green-primary);
    color: #fff;
    transform: translateY(-3px);
}

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

/* --- CONTACT PAGE --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-info-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.contact-info-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: #e8f8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.contact-info-item h4 {
    font-weight: 600;
    margin-bottom: 2px;
}

.contact-info-item p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    .dashboard-content {
        margin-left: 220px;
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        gap: 4px;
        box-shadow: var(--shadow-lg);
        transform: translateY(-120%);
        transition: var(--transition);
        border-bottom: 2px solid var(--gray-200);
    }

    .nav-menu.open {
        transform: translateY(0);
    }

    .nav-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 260px;
        z-index: 200;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .dashboard-content {
        margin-left: 0;
        padding: 20px;
    }

    .hero {
        min-height: 70vh;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .sensor-grid {
        grid-template-columns: 1fr;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .form-container {
        padding: 28px 20px;
        margin: 30px 12px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .btn {
        padding: 12px 22px;
        font-size: 0.9rem;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr;
    }

    .section {
        padding: 50px 16px;
    }
}

/* --- ANIMATIONS --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-in {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--gray-100);
}
::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}
/* Sensor card link */
.sensor-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.sensor-card-link:hover .sensor-card {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}