/**
 * Ella Lidera - Design System & Public Styles
 * Brand: Teal & Dark Emerald
 * Mobile-First Responsive Architecture
 */

:root {
  --dark: #00403a;
  --dark-hover: #002d29;
  --dark-soft: #0c534c;
  --teal: #2bd5c4;
  --teal-hover: #22b8a8;
  --teal-light: #52e1d2;
  --light: #c9f2ed;
  --mint-bg: #f0faf8;
  --white: #ffffff;
  --gray-bg: #f4f7f6;
  --gray-card: #ffffff;
  --border-color: #e0e8e6;
  --border-focus: #2bd5c4;
  --text: #162624;
  --text-muted: #556865;
  --text-light: #7c918e;
  --red: #c0392b;
  --red-bg: #fbe4e1;
  --green: #157947;
  --green-bg: #d6f5e8;
  --yellow: #8a6100;
  --yellow-bg: #fff4d6;
  --yellow-border: #e0c069;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 6px rgba(0, 40, 36, 0.04);
  --shadow-md: 0 4px 18px rgba(0, 40, 36, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 40, 36, 0.12);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--gray-bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ==========================================================================
   Header Component (Mobile Responsive)
   ========================================================================== */
.main-header {
  background: linear-gradient(135deg, var(--dark) 0%, #002b27 100%);
  color: var(--white);
  padding: 12px 16px;
  box-shadow: 0 4px 20px rgba(0, 40, 36, 0.18);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.brand-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

@media (min-width: 768px) {
  .brand-group {
    width: auto;
  }
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
}

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--teal) 0%, #76f1e4 100%);
  color: var(--dark);
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(43, 213, 196, 0.35);
  flex: none;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.brand-sub {
  font-size: 11px;
  color: var(--light);
  opacity: 0.9;
  display: block;
}

/* Mobile Hamburger Toggle */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}

@media (max-width: 767px) {
  .mobile-menu-toggle {
    display: flex;
  }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

@media (min-width: 768px) {
  .header-right {
    width: auto;
  }
}

.live-clock {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  color: var(--light);
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 767px) {
  .header-right {
    flex-direction: column;
    align-items: stretch;
    display: none;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .header-right.show-mobile {
    display: flex;
  }

  .header-nav {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 6px;
  }

  .nav-link {
    display: block;
    text-align: center;
    padding: 10px !important;
    background: rgba(255, 255, 255, 0.08);
  }

  .live-clock {
    justify-content: center;
  }
}

.nav-link {
  color: var(--light);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

.nav-link.active {
  background: var(--teal);
  color: var(--dark);
}

.nav-logout {
  color: #ffb3b3;
}

.nav-logout:hover {
  background: rgba(255, 100, 100, 0.25);
  color: #ffffff;
}

.nav-admin-btn {
  background: rgba(255, 255, 255, 0.12);
  color: var(--light);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: var(--transition);
}

.nav-admin-btn:hover {
  background: var(--teal);
  color: var(--dark);
  border-color: var(--teal);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
  flex: 1;
  padding: 18px 12px 40px;
}

@media (min-width: 768px) {
  .main-content {
    padding: 28px 16px 60px;
  }
}

.container {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.container-wide {
  max-width: 1140px;
  margin: 0 auto;
  width: 100%;
}

/* Banner Hero */
.hero-banner {
  background: linear-gradient(135deg, #00403a 0%, #045a52 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero-banner {
    padding: 24px 28px;
    margin-bottom: 22px;
  }
}

.hero-banner h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

@media (min-width: 768px) {
  .hero-banner h2 {
    font-size: 23px;
  }
}

.hero-banner p {
  font-size: 13px;
  color: var(--light);
  margin: 0;
  line-height: 1.4;
}

@media (min-width: 768px) {
  .hero-banner p {
    font-size: 14px;
  }
}

/* ==========================================================================
   Card Component
   ========================================================================== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

@media (min-width: 768px) {
  .card {
    padding: 24px 26px;
    margin-bottom: 22px;
  }
}

.card-header-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--teal) 0%, #82f6eb 100%);
  color: var(--dark);
  font-weight: 800;
  font-size: 14px;
  flex: none;
  box-shadow: 0 2px 6px rgba(43, 213, 196, 0.4);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
  letter-spacing: -0.3px;
}

@media (min-width: 768px) {
  .card-title {
    font-size: 18px;
  }
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ==========================================================================
   Sessions Grid (Responsive on Mobile)
   ========================================================================== */
.sessions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (min-width: 600px) {
  .sessions-grid {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 12px;
  }
}

@media (max-width: 360px) {
  .sessions-grid {
    grid-template-columns: 1fr;
  }
}

.sess-btn {
  border: 2px solid var(--border-color);
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 95px;
  position: relative;
  outline: none;
}

.sess-btn:hover:not(:disabled) {
  border-color: var(--teal);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.sess-btn.active {
  border-color: var(--dark);
  background: var(--mint-bg);
  box-shadow: 0 0 0 2px rgba(43, 213, 196, 0.4);
}

.sess-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #f9fbfb;
}

.sess-btn .sess-title {
  font-weight: 700;
  font-size: 12px;
  color: var(--dark);
  line-height: 1.25;
}

@media (min-width: 768px) {
  .sess-btn .sess-title {
    font-size: 13px;
  }
}

.sess-btn .sess-date {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}

.tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  align-self: flex-start;
}

.tag.open {
  background: var(--green-bg);
  color: var(--green);
}

.tag.future {
  background: #edf1f1;
  color: #728481;
}

.tag.closed {
  background: var(--red-bg);
  color: var(--red);
}

/* ==========================================================================
   Form Controls & Inputs
   ========================================================================== */
.form-group {
  margin-bottom: 12px;
}

.fld-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 5px;
}

.input-text, input[type=text], input[type=password], input[type=tel], input[type=date], select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  font-size: 16px; /* 16px previene el zoom automático de iOS en móviles */
  font-family: inherit;
  color: var(--text);
  background-color: var(--white);
  transition: var(--transition);
  outline: none;
  min-height: 48px;
}

.input-text:focus, input:focus, select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(43, 213, 196, 0.2);
}

.input-dni-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 600px) {
  .input-dni-wrapper {
    flex-direction: row;
    align-items: center;
  }
}

.input-dni-wrapper input {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Buttons */
.btn {
  background: linear-gradient(135deg, var(--dark) 0%, #002d29 100%);
  color: var(--white);
  border: none;
  padding: 13px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 40, 36, 0.18);
  min-height: 48px;
  text-align: center;
}

.btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #00554c 0%, #003833 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 40, 36, 0.25);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: linear-gradient(135deg, var(--teal) 0%, #20c3b3 100%);
  color: var(--dark);
  box-shadow: 0 2px 8px rgba(43, 213, 196, 0.35);
}

.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(135deg, #32ebd8 0%, #25d3c2 100%);
  color: var(--dark);
}

.btn-outline {
  background: transparent;
  color: var(--dark);
  border: 2px solid var(--border-color);
  box-shadow: none;
}

.btn-outline:hover:not(:disabled) {
  background: var(--gray-bg);
  border-color: var(--teal);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Results & Dynamic Boxes
   ========================================================================== */
.result-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--mint-bg) 0%, #e2f7f3 100%);
  border: 1px solid var(--light);
  display: none;
  animation: fadeIn 0.25s ease-out forwards;
}

.result-card.show {
  display: block;
}

.result-name {
  font-weight: 800;
  font-size: 16px;
  color: var(--dark);
  margin-bottom: 4px;
}

.result-details {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 14px;
}

/* Self registration box */
.newreg-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: #fffdf5;
  border: 2px dashed var(--yellow-border);
  display: none;
  animation: fadeIn 0.25s ease-out forwards;
}

.newreg-card.show {
  display: block;
}

.newreg-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--yellow);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Alerts and feedback */
.msg {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  display: none;
  animation: fadeIn 0.2s ease-out forwards;
}

.msg.show {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.msg.ok {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid #b7ecd4;
}

.msg.warn {
  background: var(--yellow-bg);
  color: var(--yellow);
  border: 1px solid #f6deb3;
}

.msg.err {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid #f6c8c3;
}

/* ==========================================================================
   Toast Notifications (Mobile Centered)
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

@media (min-width: 600px) {
  .toast-container {
    left: auto;
    right: 20px;
    bottom: 20px;
    max-width: 400px;
  }
}

.toast {
  background: var(--dark);
  color: var(--white);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  border-left: 4px solid var(--teal);
  width: 100%;
}

.toast.ok { border-left-color: #27ae60; }
.toast.err { border-left-color: #e74c3c; }
.toast.warn { border-left-color: #f39c12; }

/* ==========================================================================
   Footer Component
   ========================================================================== */
.main-footer {
  background: var(--white);
  border-top: 1px solid var(--border-color);
  padding: 16px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: auto;
}

.footer-container {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

@media (min-width: 600px) {
  .footer-container {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-domain {
  font-weight: 700;
  color: var(--dark);
}

.footer-admin-link {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-admin-link:hover {
  color: var(--dark);
  text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
