/* ════════════════════════════════════════════════════════════════════════
   FERRETERÍA LA REGALÍA DE SILOÉ — Portal Cliente
   Frontend stylesheet · v1.1
   ════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

.fm-portal {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  color: #0f172a;
}

/* Header de bienvenida */
.fm-portal-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  border-radius: 16px;
  padding: 32px 28px;
  margin-bottom: 24px;
  box-shadow: 0 12px 28px rgba(15,23,42,.12);
  position: relative;
  overflow: hidden;
}
.fm-portal-header::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(217,119,6,.3) 0%, transparent 70%);
  pointer-events: none;
}
.fm-portal-header .brand {
  display: flex; align-items: center; gap: 14px;
  font-weight: 600; font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fbbf24;
  margin-bottom: 12px;
  position: relative;
}
.fm-portal-header .brand-icon {
  width: 32px; height: 32px;
  background: #b45309; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(180,83,9,.4);
  flex-shrink: 0;
}
.fm-portal-header .brand-icon svg { width: 18px; height: 18px; }
.fm-portal-header h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  color: #fff;
  position: relative;
}
.fm-portal-header p {
  color: rgba(255,255,255,.75);
  margin: 0;
  font-size: 14px;
  position: relative;
}

/* Navegación de secciones */
.fm-portal-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: #fff;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
  border: 1px solid #e2e8f0;
  overflow-x: auto;
}
.fm-portal-nav a {
  padding: 10px 18px;
  text-decoration: none;
  color: #64748b;
  font-weight: 600;
  font-size: 13.5px;
  border-radius: 8px;
  transition: all .15s ease;
  white-space: nowrap;
}
.fm-portal-nav a:hover { color: #b45309; background: #fef3c7; }
.fm-portal-nav a.active {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(180,83,9,.3);
}

.fm-portal-section { display: none; }
.fm-portal-section.active { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from {opacity:0; transform:translateY(4px);} to {opacity:1; transform:translateY(0);} }

/* Tabla del portal */
.fm-portal-table-wrap {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}
.fm-portal-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.fm-portal-table thead th {
  background: #f8fafc;
  color: #475569;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e2e8f0;
}
.fm-portal-table tbody tr { border-bottom: 1px solid #f1f5f9; transition: background .15s; }
.fm-portal-table tbody tr:hover { background: #f8fafc; }
.fm-portal-table tbody tr:last-child { border-bottom: 0; }
.fm-portal-table tbody td { padding: 12px 16px; }

.fm-portal-empty {
  text-align: center;
  padding: 48px 20px;
  color: #94a3b8;
}

.fm-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Login message */
.fm-portal-login {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 56px 24px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
  max-width: 480px;
  margin: 40px auto;
}
.fm-portal-login p { color: #475569; margin-bottom: 16px; }
.fm-portal-login a {
  color: #b45309;
  font-weight: 600;
  text-decoration: none;
}
.fm-portal-login a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
  .fm-portal { padding: 16px 12px 40px; }
  .fm-portal-header { padding: 24px 20px; border-radius: 12px; }
  .fm-portal-header h2 { font-size: 21px; }
  .fm-portal-nav { padding: 4px; border-radius: 10px; }
  .fm-portal-nav a { padding: 9px 14px; font-size: 12.5px; }
  .fm-portal-table { font-size: 12.5px; min-width: 540px; }
  .fm-portal-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .fm-portal-table thead th, .fm-portal-table tbody td { padding: 10px 12px; }
}

/* ════════════════════════════════════════════════════════════════════════
   FM LOGIN — Pantalla de acceso profesional
   ════════════════════════════════════════════════════════════════════════ */

.fm-login-wrap {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: calc(100vh - 60px);
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  margin: -1.5em 0 -1.5em;
  position: relative;
  overflow: hidden;
}

.fm-login-bg-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(217,119,6,.18) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(180,83,9,.12) 0%, transparent 40%);
  pointer-events: none;
}

.fm-login-box {
  position: relative;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 48px rgba(0,0,0,.35), 0 12px 28px rgba(0,0,0,.18);
  width: 100%;
  max-width: 430px;
  padding: 40px 36px 32px;
  animation: fm-login-in .4s cubic-bezier(.16,1,.3,1);
}
@keyframes fm-login-in {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.fm-login-brand {
  text-align: center;
  margin-bottom: 28px;
}
.fm-login-icon {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  color: #fff;
  box-shadow: 0 12px 28px rgba(180,83,9,.4), 0 4px 12px rgba(180,83,9,.3);
}
.fm-login-icon svg { width: 34px; height: 34px; }
.fm-login-brand h1 {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.fm-login-brand p {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.fm-login-field {
  margin-bottom: 16px;
}
.fm-login-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.fm-login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.fm-login-input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  opacity: .5;
  pointer-events: none;
}
.fm-login-input-wrap input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 14px 13px 42px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  background: #f8fafc;
  color: #0f172a;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.fm-login-input-wrap input:focus {
  outline: none;
  border-color: #d97706;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(217,119,6,.12);
}
.fm-login-toggle-pass {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 10px;
  font-size: 16px;
  opacity: .5;
  transition: opacity .15s;
}
.fm-login-toggle-pass:hover { opacity: 1; }

.fm-login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 20px;
  font-size: 12.5px;
  flex-wrap: wrap;
  gap: 10px;
}
.fm-login-checkbox {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #475569;
  cursor: pointer;
  font-weight: 500;
}
.fm-login-checkbox input {
  width: 16px; height: 16px;
  accent-color: #b45309;
  cursor: pointer;
}
.fm-login-forgot {
  color: #b45309;
  text-decoration: none;
  font-weight: 600;
  transition: color .15s;
}
.fm-login-forgot:hover { color: #92400e; text-decoration: underline; }

.fm-login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 16px rgba(180,83,9,.35);
  transition: transform .15s, box-shadow .15s, opacity .15s;
  font-family: 'Inter', sans-serif;
}
.fm-login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(180,83,9,.45);
  color: #fff;
}
.fm-login-btn:active { transform: translateY(0); }
.fm-login-btn:disabled { opacity: .6; cursor: wait; transform: none; }

.fm-login-link {
  display: block;
  text-align: center;
  margin-top: 10px;
  color: #64748b;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.fm-login-link:hover { color: #b45309; }

.fm-login-alert {
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid;
}
.fm-login-alert-error   { background: #fee2e2; color: #991b1b; border-color: #dc2626; }
.fm-login-alert-success { background: #d1fae5; color: #065f46; border-color: #059669; }

.fm-logged-in {
  text-align: center;
  padding: 20px 0 8px;
}
.fm-logged-in p { color: #475569; margin-bottom: 16px; font-size: 14px; }
.fm-logged-in .fm-login-btn { margin-bottom: 10px; }

.fm-login-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
  text-align: center;
}
.fm-login-footer p {
  font-size: 12px;
  color: #475569;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: 0.05em;
}
.fm-login-footer small {
  font-size: 10.5px;
  color: #94a3b8;
  letter-spacing: 0.03em;
}

/* Responsive */
@media (max-width: 480px) {
  .fm-login-box { padding: 32px 24px 24px; border-radius: 16px; }
  .fm-login-brand h1 { font-size: 19px; }
  .fm-login-options { flex-direction: column; align-items: flex-start; }
}
