/* Variables de colores */
:root {
    --primary: #1a73e8;
    --primary-dark: #0d47a1;
    --secondary: #03a9f4;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray: #6c757d;
    --border: #dee2e6;
}

/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

a {
    text-decoration: none;
    color: var(--primary);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.text-center {
    text-align: center;
}

/* Header */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.logo i {
    margin-right: 10px;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background-color: rgba(26, 115, 232, 0.1);
}

.nav-links .btn-primary {
    background-color: var(--primary);
    color: white;
}

.nav-links .btn-primary:hover {
    background-color: var(--primary-dark);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark);
}

/* Hero section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 30px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-light {
    background-color: white;
    color: var(--primary);
}

.btn-light:hover {
    background-color: #f0f0f0;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid white;
    color: white;
    margin-left: 15px;
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Features section */
.features {
    padding: 80px 0;
    background-color: white;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 15px;
}

.section-title p {
    color: var(--gray);
    max-width: 800px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background-color: rgba(26, 115, 232, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.8rem;
    color: var(--primary);
}

.feature-card h3 {
    margin-bottom: 15px;
    color: var(--dark);
}

.feature-card p {
    color: var(--gray);
}

/* Auth forms */
.auth-container {
    max-width: 450px;
    margin: 60px auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--gray);
}

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

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.auth-form input:focus {
    border-color: var(--primary);
    outline: none;
}

.auth-form .btn-submit {
    width: 100%;
    padding: 12px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.auth-form .btn-submit:hover {
    background-color: var(--primary-dark);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--gray);
}

/* Footer */
footer {
    background-color: var(--dark);
    color: white;
    padding: 60px 0 30px;
}

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

.footer-column h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #adb5bd;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

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

/* Responsive styles */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background-color: white;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        padding: 20px;
    }

    .nav-links.show {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }

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

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

    .btn {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }

    .btn-outline {
        margin-left: 0;
    }
}

/* Conectar ESP32 UI */
.conn-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  padding:14px;
  margin-bottom:12px;
}
.conn-header{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:10px;
}
.status-label{ font-weight:700; color:var(--dark); }
.status-pill{
  display:inline-block;
  padding:6px 10px;
  border-radius:9999px;
  font-weight:600;
  font-size:.95rem;
  border:1px solid transparent;
}
.status-pill.disconnected{ background:#fff5f5; color:#c62828; border-color:#ffcdd2; }
.status-pill.connecting{ background:#e3f2fd; color:#1565c0; border-color:#bbdefb; }
.status-pill.connected{ background:#e8f5e9; color:#2e7d32; border-color:#c8e6c9; }
.status-pill.error{ background:#ffebee; color:#b71c1c; border-color:#ffcdd2; }

/* Botón principal: grande, centrado y con hover */
.conn-actions {
  display:flex;
  justify-content:center;
  margin:12px 0;
}
.conn-actions .btn-submit {
  min-width:260px;
  padding:12px 22px;
  font-size:1.05rem;
  border-radius:10px;
  transition: background .15s ease, transform .05s ease, filter .15s ease;
}
.conn-actions .btn-submit:hover {
  filter:brightness(0.95);
}
.conn-actions .btn-submit:active {
  transform:translateY(1px);
}

.conn-instructions h4{ margin:10px 0 8px; }
.instruction-list{ margin-left:18px; line-height:1.5; }

.sec-title{ margin:0 0 8px; font-size:1rem; font-weight:700; }
.device-id-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  padding:14px;
}
.device-id-row{
  display:flex; gap:10px; align-items:center; margin-bottom:10px;
}
.device-id-row label{ min-width:140px; font-weight:600; }
.device-id-row input{ flex:1; background:#f1f3f5; }
.btn-secondary{
  background:#eef3ff; border:1px solid var(--primary);
  color:var(--primary); padding:8px 12px; border-radius:8px; cursor:pointer;
}
.btn-secondary:hover{ filter:brightness(0.97); }

.quick-grid{
  display:grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap:8px;
  margin-bottom:6px;
}
.qk-label{ font-weight:600; color:var(--dark); }

.sensor-dot{ padding:2px 8px; border-radius:9999px; border:1px solid var(--border); }
.sensor-dot.ok{ background:#e8f5e9; color:#2e7d32; border-color:#c8e6c9; }
.sensor-dot.fail{ background:#ffebee; color:#b71c1c; border-color:#ffcdd2; }
.sensor-dot.unknown{ background:#f1f3f5; color:#6b7280; }
