/*
  El Rinconín · Estilos base
  Variables CSS, reset, tipografía, login y pantallas comunes.
*/

:root {
  --bg: #f5ede1; --bg-dark: #2d1810; --paper: #faf4e8;
  --ink: #2d1810; --ink-soft: #6b4e3d;
  --accent: #a8432c; --accent-soft: #c97059;
  --gold: #b8904a; --sage: #7a8a5f;
  --line: #d9c9b0; --line-soft: #e8dcc5;
  --shadow: 0 1px 2px rgba(45, 24, 16, 0.06), 0 8px 24px rgba(45, 24, 16, 0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow-x: hidden; }
body {
  font-family: 'Inter', sans-serif; background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.5; min-height: 100vh;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(184, 144, 74, 0.08), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(168, 67, 44, 0.06), transparent 50%);
}
h1, h2, h3 { font-family: 'Fraunces', serif; font-weight: 600; letter-spacing: -0.01em; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

.loader-full {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--bg-dark); color: var(--gold); z-index: 1000;
  font-family: 'Fraunces', serif; font-style: italic; font-size: 18px;
}
.loader-full.hidden { display: none; }
.spinner {
  width: 24px; height: 24px; border: 2px solid rgba(184,144,74,0.3);
  border-top-color: var(--gold); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin-right: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* LOGIN */
.login-screen {
  min-height: 100vh; display: none; align-items: center; justify-content: center;
  padding: 24px; background: linear-gradient(180deg, #2d1810 0%, #3d2418 100%);
  position: relative; overflow: hidden;
}
.login-screen.active { display: flex; }
.login-screen::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 30% 20%, rgba(184, 144, 74, 0.15), transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(168, 67, 44, 0.12), transparent 40%);
}
.login-card {
  background: var(--paper); padding: 48px 36px 40px; border-radius: 4px;
  max-width: 380px; width: 100%; position: relative;
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
  border: 1px solid rgba(184, 144, 74, 0.2);
}
.login-brand { text-align: center; margin-bottom: 32px; }
.login-logo {
  width: 100%; max-width: 290px; height: auto; display: block;
  margin: 0 auto;
  /* Pequeña sombra suave para integrar con el papel */
  filter: drop-shadow(0 1px 2px rgba(45, 24, 16, 0.08));
}

.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 8px;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; background: rgba(255,255,255,0.6);
  border: 1px solid var(--line); border-radius: 2px;
  font-size: 15px; color: var(--ink);
  transition: border-color 0.2s, background 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); background: #fff;
}
.btn-primary {
  width: 100%; padding: 14px; background: var(--ink); color: var(--paper);
  border-radius: 2px; font-size: 13px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  transition: background 0.2s, transform 0.1s; margin-top: 8px;
}
.btn-primary:hover { background: var(--accent); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.login-hint {
  margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--ink-soft); text-align: center; line-height: 1.6;
}
.error-msg {
  background: rgba(168, 67, 44, 0.1); color: var(--accent);
  padding: 10px 12px; border-radius: 2px; font-size: 13px;
  margin-bottom: 16px; border-left: 3px solid var(--accent);
}

.app { display: none; min-height: 100vh; padding-bottom: 80px; }
.app.active { display: block; }
.app-header {
  background: var(--bg-dark); color: var(--paper);
  padding: 16px 20px 20px; position: sticky; top: 0; z-index: 10;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.app-header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.app-brand { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 700; font-style: italic; }
.user-chip { font-size: 13px; color: var(--gold); }
.logout-btn {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--paper); opacity: 0.6; padding: 4px 8px;
  border: 1px solid rgba(250, 244, 232, 0.2); border-radius: 2px;
}
.logout-btn:hover { opacity: 1; }

.tabs {
  display: flex; background: var(--paper); border-bottom: 1px solid var(--line);
  position: sticky; top: 73px; z-index: 9; overflow-x: auto;
}
.tab {
  flex: 1; padding: 14px 8px; font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-soft); position: relative; transition: color 0.2s; white-space: nowrap;
}
.tab.active { color: var(--accent); }
.tab.active::after {
  content: ''; position: absolute; bottom: -1px; left: 15%; right: 15%;
  height: 2px; background: var(--accent);
}
.tab-content { display: none; padding: 20px 16px; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

