/* ============================================================
   Maccaferri eDesign · Software suite — replica styling
   ============================================================ */
:root {
  --mac-red: #e2001a;
  --mac-red-dark: #b80016;
  --ink: #1c2024;
  --ink-soft: #5b636b;
  --line: #e4e7ea;
  --bg: #f4f6f8;
  --card: #ffffff;
  --shadow: 0 2px 6px rgba(20, 30, 40, .08), 0 12px 28px rgba(20, 30, 40, .06);
  --radius: 10px;
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Ensure the [hidden] attribute always wins over class display rules
   (.btn, .user-box, etc. set display:flex which would otherwise override it). */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--mac-red); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

code {
  background: #eef1f4;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .9em;
}

/* Inline SVG icons inside buttons */
.btn-ico { display: block; flex: none; }

/* ---------------- Header ---------------- */
.site-header {
  background: #fff;
  border-bottom: 3px solid var(--mac-red);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 38px; width: auto; display: block; }
.brand-sub {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: .5px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.header-nav { display: flex; align-items: center; gap: 14px; }

.user-box { display: flex; align-items: center; gap: 12px; }
.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--mac-red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-weight: 600; font-size: .92rem; }
.user-email { font-size: .8rem; color: var(--ink-soft); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 16px;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--mac-red); color: #fff; }
.btn-primary:hover { background: var(--mac-red-dark); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-soft); }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; }

/* ---------------- Hero ---------------- */
.hero {
  background:
    radial-gradient(1200px 400px at 12% -20%, rgba(226, 0, 26, .45), transparent 60%),
    linear-gradient(120deg, #15181b 0%, #20262b 55%, #2c343a 100%);
  color: #fff;
  padding: 64px 0 56px;
}
.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: .78rem;
  margin: 0 0 6px;
  color: #ffd2d7;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.1rem);
  margin: 0 0 14px;
  font-weight: 700;
}
.hero-text { max-width: 640px; margin: 0; color: #e9edf1; font-size: 1.08rem; }

/* ---------------- Auth gate ---------------- */
.auth-gate { padding: 56px 24px; display: flex; justify-content: center; }
.auth-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px 40px;
  text-align: center;
  max-width: 460px;
}
.auth-lock {
  font-size: 44px;
  color: var(--mac-red);
  background: #fdecee;
  width: 84px; height: 84px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.auth-card h2 { margin: 6px 0 8px; }
.auth-card p { color: var(--ink-soft); margin: 0 0 22px; }
.auth-note { font-size: .8rem; color: var(--ink-soft); margin-top: 18px !important; }

/* ---------------- Status banner ---------------- */
.status-banner {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 8px;
  font-weight: 500;
}
.status-banner.error { background: #fdecee; color: var(--mac-red-dark); border: 1px solid #f6c6cd; }
.status-banner.info  { background: #eef4fb; color: #1c4e80; border: 1px solid #cfe0f3; }

/* ---------------- Software suite ---------------- */
.suite { padding: 48px 24px 64px; }
.suite-head { margin-bottom: 28px; }
.suite-head h2 { margin: 0 0 6px; font-size: 1.7rem; }
.suite-head p { margin: 0; color: var(--ink-soft); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 24px;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 24px 24px 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  transition: transform .22s cubic-bezier(.2, .7, .3, 1),
              box-shadow .22s ease, border-color .22s ease;
}
/* Brand accent bar that grows in on hover */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--mac-red), #ff5a6e);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.card:hover {
  transform: translateY(-6px);
  border-color: #f3b9c0;
  box-shadow: 0 18px 40px rgba(20, 30, 40, .16);
}
.card:hover::before { transform: scaleX(1); }
a.card:focus-visible {
  outline: none;
  border-color: var(--mac-red);
  box-shadow: 0 0 0 3px rgba(226, 0, 26, .22), var(--shadow);
}

.card-logo-wrap {
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 12px;
  background:
    radial-gradient(120% 120% at 50% 0%, #fafbfc 0%, #f1f4f7 100%);
  border: 1px solid var(--line);
}
.card-logo {
  max-height: 72px;
  max-width: 100%;
  object-fit: contain;
  transition: transform .22s ease;
}
.card:hover .card-logo { transform: scale(1.04); }

/* Monogram fallback tile when no logo is available / fails to load */
.card-logo-wrap--fallback {
  background: linear-gradient(135deg, #20262b 0%, #2c343a 100%);
  border-color: transparent;
}
.card-logo-mono {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
}

.card-title {
  font-size: 1.18rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink);
}
.card-desc {
  color: var(--ink-soft);
  font-size: .92rem;
  margin: 0 0 20px;
  flex: 1;
}
.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--mac-red);
  align-self: flex-start;
}
.card-cta-label { position: relative; }
.card-cta-label::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s ease;
}
.card:hover .card-cta-label::after { transform: scaleX(1); }
.cta-arrow { display: block; transition: transform .22s ease; }
.card:hover .cta-arrow { transform: translateX(5px); }

/* Card without a configured destination URL */
.card-unconfigured {
  cursor: default;
  border-style: dashed;
  opacity: .8;
}
.card-unconfigured::before { display: none; }
.card-unconfigured:hover {
  transform: none;
  box-shadow: var(--shadow);
  border-color: var(--line);
}
.card-unconfigured:hover .card-logo { transform: none; }
.card-unconfigured .card-cta { color: var(--ink-soft); }

/* ---------------- Footer ---------------- */
.site-footer {
  background: #1c2024;
  color: #c7ccd1;
  margin-top: 40px;
  padding: 34px 0;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
}
.footer-logo { height: 34px; filter: brightness(0) invert(1); }
.footer-text { font-size: .88rem; line-height: 1.5; }
.footer-text a { color: #ff8a96; }
.footer-copy { margin-left: auto; font-size: .8rem; color: #8b9298; }

/* ---------------- Loading ---------------- */
.is-busy { opacity: .55; pointer-events: none; }

@media (max-width: 640px) {
  .header-inner { height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px; flex-wrap: wrap; }
  .user-meta { display: none; }
  .footer-copy { margin-left: 0; }
}
