/* ═══════════════════════════════════════════════════════════
   Ivan Patzaichin 2050 — Lodge of Mark Master Masons
   Design 2026: clasic, atemporal, serios — Baskerville,
   ivoriu cald × bleumarin închis × cardinal purple
   ═══════════════════════════════════════════════════════════ */

@import url('../fonts/fonts.css');

:root {
  --navy:      #0B2545;
  --navy-2:    #13315C;
  --navy-3:    #1B3F73;
  --purple:    #6E1E5A;   /* cardinal purple */
  --purple-2:  #8E2A74;
  --purple-soft: #F5EAF1;
  --navy-soft: #EBF0F6;
  --bg:        #F7F5F0;   /* ivoriu cald, ton de hârtie */
  --surface:   #FFFFFF;
  --ink:       #1C2A3E;
  --muted:     #6B7386;
  --line:      #E3E0D6;   /* linie caldă, discretă */
  --line-cool: #E2E8F1;
  --ok:        #14683F;
  --ok-soft:   #E7F3EC;
  --warn:      #A33020;
  --warn-soft: #FAECE8;
  --radius:    14px;
  --radius-sm: 10px;
  --shadow:    0 1px 2px rgba(11,37,69,.05), 0 6px 18px rgba(11,37,69,.05);
  --shadow-lg: 0 3px 8px rgba(11,37,69,.08), 0 14px 40px rgba(11,37,69,.12);
  --serif: "Libre Baskerville", Baskerville, "Baskerville Old Face", "Hoefler Text", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--navy-3); text-decoration: none; }
a:hover { color: var(--purple); }
h1, h2, h3 { line-height: 1.3; color: var(--navy); margin: .3em 0 .5em; font-weight: 700; letter-spacing: .01em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: .98rem; }
code { background: var(--navy-soft); padding: 2px 7px; border-radius: 6px; font-size: .85em; }
.muted { color: var(--muted); }

/* ── Bara de sus ─────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(100deg, var(--navy) 0%, var(--navy-2) 62%, var(--purple) 135%);
  color: #fff;
  padding-top: env(safe-area-inset-top);
  box-shadow: var(--shadow);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.topbar-inner {
  display: flex; align-items: center; gap: 10px;
  max-width: 1240px; margin: 0 auto; padding: 9px 16px;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; min-width: 0; }
.brand:hover { color: #fff; }
.brand-logo { width: 44px; height: 44px; border-radius: 50%; background: #fff; padding: 2px; flex-shrink: 0; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-txt strong { font-size: .98rem; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-txt small { opacity: .8; font-size: .68rem; font-style: italic; letter-spacing: .05em; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar-user .avatar { border: 2px solid rgba(255,255,255,.7); }
.iconbtn {
  background: rgba(255,255,255,.12); color: #fff; border: 0;
  border-radius: 10px; padding: 8px 12px; font-size: 1rem; cursor: pointer; font-family: inherit;
}
.iconbtn:hover { background: rgba(255,255,255,.22); color: #fff; }
.menu-btn { display: none; }

/* Comutatorul de limbă RO/EN */
.langswitch { display: inline-flex; background: rgba(255,255,255,.14); border-radius: 999px; padding: 3px; }
.langswitch a {
  color: #fff; font-size: .74rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; letter-spacing: .06em;
}
.langswitch a.on { background: #fff; color: var(--navy); }

/* ── Structura paginii ───────────────────────────────────── */
.shell { display: flex; max-width: 1240px; margin: 0 auto; min-height: calc(100vh - 130px); }
.sidenav {
  width: 252px; flex-shrink: 0; padding: 20px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.navitem {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px; border-radius: var(--radius-sm);
  color: var(--ink); font-size: .92rem;
  border-left: 3px solid transparent;
}
.navitem:hover { background: var(--navy-soft); color: var(--navy); }
.navitem.on { background: var(--purple-soft); color: var(--purple); font-weight: 700; border-left-color: var(--purple); }
.navitem.sub { padding: 6px 14px 6px 30px; font-size: .82rem; }
.ni-icon { width: 22px; text-align: center; }
.navsec {
  margin: 16px 14px 5px; font-size: .66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em; color: var(--muted);
}
.content { flex: 1; padding: 26px 22px 48px; min-width: 0; }
.footer {
  text-align: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  color: var(--muted); font-size: .78rem; font-style: italic;
  border-top: 1px solid var(--line); letter-spacing: .03em;
}
.scrim { display: none; }

/* ── Carduri și elemente comune ──────────────────────────── */
.card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 22px 26px; margin-bottom: 18px;
}
.card.narrow { max-width: 560px; }
.pagetitle { margin-top: 0; padding-bottom: 10px; position: relative; }
.pagetitle::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 52px; height: 3px; background: linear-gradient(90deg, var(--navy), var(--purple));
}
.sectiontitle { margin-top: 28px; }
.backlink { display: inline-block; margin-bottom: 10px; font-size: .85rem; color: var(--muted); font-style: italic; }

.flash {
  padding: 12px 18px; border-radius: var(--radius-sm); margin-bottom: 14px;
  font-weight: 700; font-size: .9rem; animation: slidein .25s ease; border: 1px solid transparent;
}
.flash-ok  { background: var(--ok-soft); color: var(--ok); border-color: #CBE5D6; }
.flash-err { background: var(--warn-soft); color: var(--warn); border-color: #F0D2CA; }
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); } }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--navy-soft); color: var(--navy);
  border-radius: 999px; padding: 3px 12px;
  font-size: .68rem; font-weight: 700; letter-spacing: .05em;
  white-space: nowrap;
}
.chip-purple { background: var(--purple-soft); color: var(--purple); }
.chip-navy   { background: var(--navy); color: #fff; }
.chip-ok     { background: var(--ok-soft); color: var(--ok); }
.chip-warn   { background: var(--warn-soft); color: var(--warn); }

.listrow {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.listrow:last-child { border-bottom: 0; }
.rowactions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rowactions form { display: inline; }

/* ── Statistici (dashboard) ──────────────────────────────── */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 2px;
  color: var(--muted); font-size: .78rem; letter-spacing: .02em;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--purple); }
.stat-num { font-size: 1.5rem; font-weight: 700; color: var(--navy); font-family: var(--serif); }
.stat-warn .stat-num { color: var(--warn); }

/* ── Grila de module ─────────────────────────────────────── */
.modgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.modcard {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 22px 20px; display: flex; flex-direction: column; gap: 4px;
  color: var(--ink); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.modcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--ink); border-color: var(--purple); }
.modcard small { font-size: .78rem; font-style: italic; }
.modicon { font-size: 1.6rem; }

/* ── Formulare ───────────────────────────────────────────── */
form label { display: block; margin-bottom: 13px; font-weight: 700; font-size: .8rem; color: var(--navy-2); letter-spacing: .02em; }
input, select, textarea {
  display: block; width: 100%; margin-top: 5px;
  font: inherit; font-size: .92rem; color: var(--ink);
  background: #FDFCFA; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--purple); box-shadow: 0 0 0 3px rgba(110,30,90,.12); background: #fff;
}
input[type="checkbox"], input[type="radio"] {
  display: inline-block; width: auto; margin: 0 6px 0 0; accent-color: var(--purple); transform: scale(1.15);
}
.checkline { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.fieldrow { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.fieldrow label { flex: 1; min-width: 120px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 0 0 14px; padding: 10px 14px; }
legend { font-size: .74rem; font-weight: 700; color: var(--muted); padding: 0 6px; letter-spacing: .04em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--serif); font-weight: 700; font-size: .82rem; letter-spacing: .03em;
  background: var(--surface); color: var(--navy);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 20px;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .1s;
  text-decoration: none;
}
.btn:hover { border-color: var(--navy); background: var(--navy-soft); color: var(--navy); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn-danger { background: var(--warn-soft); color: var(--warn); border-color: #F0D2CA; }
.btn-danger:hover { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 13px; font-size: .74rem; }

/* ── Tabele ──────────────────────────────────────────────── */
.tablewrap { overflow-x: auto; margin: 0 -8px; }
table { border-collapse: collapse; width: 100%; min-width: 560px; }
th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 8px; border-bottom: 2px solid var(--navy); }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .9rem; }
tr:last-child td { border-bottom: 0; }

/* ── Avatare și membri ───────────────────────────────────── */
.avatar { border-radius: 50%; object-fit: cover; display: inline-block; flex-shrink: 0; }
.avatar-txt {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy-3), var(--purple));
  color: #fff; font-weight: 700;
}
.searchbar { display: flex; gap: 10px; margin-bottom: 18px; max-width: 440px; }
.searchbar input { margin: 0; }
.membergrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.membercard {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 26px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--ink); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.membercard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--ink); border-color: var(--purple); }
.membercard .avatar { border: 3px solid var(--navy-soft); }
.profile-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; }
.proplist { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 14px 0; }
.proplist dt { font-weight: 700; color: var(--muted); font-size: .8rem; }
.proplist dd { margin: 0; }

/* ── Mesagerie / avizier ─────────────────────────────────── */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 7px 18px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); font-weight: 700; font-size: .8rem; color: var(--ink); letter-spacing: .02em;
}
.tab.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.msgrow.unread strong { color: var(--purple); }
.msgrow.unread::before { content: "●"; color: var(--purple); margin-right: 8px; }
.boardpost.pinned { border-left: 4px solid var(--purple); }

/* ── Calendar ────────────────────────────────────────────── */
.calhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.caldow { text-align: center; font-size: .64rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; padding: 4px 0; }
.calcell { min-height: 64px; border-radius: 8px; background: var(--bg); border: 1px solid transparent; padding: 4px 6px; font-size: .74rem; overflow: hidden; }
.calcell.empty { background: transparent; }
.calcell.today { border-color: var(--purple); background: var(--purple-soft); }
.calday { font-weight: 700; color: var(--muted); font-size: .68rem; }
.calev {
  display: block; background: var(--navy); color: #fff; border-radius: 5px;
  padding: 1px 6px; margin-top: 2px; font-size: .64rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Voturi ──────────────────────────────────────────────── */
.pollopt-res { position: relative; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line); padding: 10px 14px; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 10px; overflow: hidden; }
.pollopt-res.mine { border-color: var(--purple); }
.pollbar { position: absolute; inset: 0; width: var(--w, 0%); background: linear-gradient(90deg, var(--navy-soft), var(--purple-soft)); transition: width .6s ease; }
.pollopt-res span, .pollopt-res strong { position: relative; }

/* ── Călătorii / echipaje ────────────────────────────────── */
.boatgrid, .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.crewrow { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.crewrow:last-of-type { border-bottom: 0; }
.crewrow .chip { margin-left: auto; }
.settlement { border-top: 3px solid var(--purple); }
.splitrow { display: flex; align-items: center; gap: 10px; }
.splitrow .checkline { flex: 1; margin-bottom: 6px; }
.pctinput { width: 90px !important; margin: 0 0 6px; padding: 6px 10px; }

/* Constructorul de echipaje (drag & drop) */
.crewboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; align-items: start; }
.crewcol {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 14px; min-height: 180px; transition: outline-color .15s, background .15s;
  outline: 2px dashed transparent;
}
.crewcol.dragover { outline-color: var(--purple); background: var(--purple-soft); }
.crewcol h3 { display: flex; align-items: center; justify-content: space-between; margin-top: 0; }
.crewcard {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 10px; margin-bottom: 8px; cursor: grab; user-select: none;
}
.crewcard:active { cursor: grabbing; }
.crewcard.dragging { opacity: .45; }
.crewname { flex: 1; font-size: .82rem; font-weight: 700; line-height: 1.3; }
.roleselect { width: auto; margin: 0; padding: 5px 8px; font-size: .7rem; border-radius: 8px; }

/* ── Autentificare / pagini publice ──────────────────────── */
.auth-body {
  min-height: 100vh; margin: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(142,42,116,.32), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(27,63,115,.5), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 55%, var(--purple) 140%);
  padding: 24px 16px;
}
.auth-card {
  background: var(--surface); border-radius: 18px;
  border: 1px solid rgba(255,255,255,.4);
  box-shadow: var(--shadow-lg), 0 0 0 6px rgba(255,255,255,.06);
  width: 100%; max-width: 430px; padding: 38px 34px; position: relative; text-align: center;
}
.auth-card h1 { margin: 8px 0 0; letter-spacing: .03em; font-size: 1.35rem; }
.auth-card form { text-align: left; margin-top: 20px; }
.auth-logo { width: 96px; height: 96px; margin: 0 auto; display: block; }
.auth-lang { position: absolute; top: 18px; right: 18px; background: var(--navy-soft); }
.auth-lang a { color: var(--navy); }
.auth-lang a.on { background: var(--navy); color: #fff; }
.auth-slogan { font-style: italic; letter-spacing: .06em; margin-top: 4px; font-size: .9rem; }
.auth-guest { margin-top: 18px; font-size: .85rem; }

/* ── Responsive: tabletă și mobil ────────────────────────── */
@media (max-width: 960px) {
  .menu-btn { display: inline-flex; }
  .sidenav {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    background: var(--surface); width: 276px; padding-top: 24px;
    transform: translateX(-105%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg); overflow-y: auto;
    border-right: 1px solid var(--line);
  }
  .sidenav.open { transform: translateX(0); }
  .scrim {
    display: block; position: fixed; inset: 0; z-index: 50;
    background: rgba(11,37,69,.45); opacity: 0; pointer-events: none; transition: opacity .22s;
  }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .content { padding: 18px 14px 40px; }
  .brand-txt small { display: none; }
  .brand-txt strong { font-size: .88rem; max-width: 46vw; }
}
@media (max-width: 560px) {
  .card { padding: 18px 16px; }
  h1 { font-size: 1.3rem; }
  .grid2, .boatgrid { grid-template-columns: 1fr; }
  .calcell { min-height: 46px; }
  .calev { display: none; }
  .calcell.today { background: var(--purple); }
  .proplist { grid-template-columns: 1fr; gap: 2px; }
  .proplist dd { margin-bottom: 8px; }
  .auth-card { padding: 28px 22px; }
}
