/* ============================================================
   guilhermegomes.pt — CSS global
   Filosofia: system fonts, zero dependências externas, zero JS
   ============================================================ */

/* --- Reset minimalista --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Tokens de cor — light mode default --- */
:root {
  --bg:       #fafafa;
  --fg:       #0a0a0a;
  --fg-muted: #6b6b6b;
  --border:   rgba(0, 0, 0, 0.08);
  --tile-bg:  #ffffff;
  --tile-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  --tile-shadow-hover: 0 2px 8px rgba(0,0,0,0.10), 0 8px 32px rgba(0,0,0,0.10);
  --btn-bg:   #0a0a0a;
  --btn-fg:   #fafafa;
  --btn-hover-bg: #1a1a1a;
  --radius-tile: 18px;
  --radius-btn:  100px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #0a0a0a;
    --fg:       #f5f5f5;
    --fg-muted: #8a8a8a;
    --border:   rgba(255, 255, 255, 0.08);
    --tile-bg:  #161616;
    --tile-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.3);
    --tile-shadow-hover: 0 2px 8px rgba(0,0,0,0.5), 0 8px 32px rgba(0,0,0,0.4);
    --btn-bg:   #f5f5f5;
    --btn-fg:   #0a0a0a;
    --btn-hover-bg: #e0e0e0;
  }
}

/* --- Base --- */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
               "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  min-height: 100dvh;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* --- Logo SVG — herda cor via currentColor --- */
.logo svg,
.logo-sm svg {
  color: var(--fg);
  display: block;
}

/* ============================================================
   LANDING — index.html
   ============================================================ */

.landing {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  position: relative;
}

.landing__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-align: center;
  max-width: 480px;
  width: 100%;
}

.landing__logo {
  margin-bottom: 2.5rem;
  color: var(--fg);
}

.landing__logo svg {
  width: 72px;
  height: 72px;
}

.landing__name {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--fg);
  line-height: 1.2;
  margin-bottom: 0.6rem;
}

.landing__tagline {
  font-size: 0.9rem;
  color: var(--fg-muted);
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-bottom: 3rem;
}

/* Botão Entrar */
.btn-enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2.4rem;
  background-color: var(--btn-bg);
  color: var(--btn-fg);
  border: none;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 0.975rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease,
              box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  min-width: 140px;
  min-height: 50px; /* polegar-friendly em mobile */
}

.btn-enter:hover {
  background-color: var(--btn-hover-bg);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.btn-enter:active {
  transform: translateY(0);
  box-shadow: none;
}

@media (prefers-color-scheme: dark) {
  .btn-enter:hover {
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.08);
  }
}

/* Footer */
.landing__footer {
  position: absolute;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--fg-muted);
  opacity: 0.5;
}

/* ============================================================
   PORTAL — portal.html
   ============================================================ */

.portal {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Header */
.portal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background-color: var(--bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}

.portal__header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-sm svg {
  width: 32px;
  height: 32px;
  color: var(--fg);
}

.portal__greeting {
  font-size: 0.975rem;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.01em;
}

/* Botão Sair */
.btn-logout {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease,
              background-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-logout:hover {
  color: var(--fg);
  border-color: var(--fg);
  background-color: var(--border);
}

/* Grid de tiles */
.portal__main {
  flex: 1;
  padding: 3rem 2rem 4rem;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.portal__section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 1.25rem;
}

.tiles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 720px) {
  .tiles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .portal__main {
    padding: 2rem 1.25rem 3rem;
  }
}

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

/* Tile */
.tile {
  background-color: var(--tile-bg);
  border-radius: var(--radius-tile);
  border: 1px solid var(--border);
  box-shadow: var(--tile-shadow);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease,
              border-color 0.2s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-height: 130px;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--tile-shadow-hover);
  border-color: rgba(0, 0, 0, 0.14);
}

@media (prefers-color-scheme: dark) {
  .tile:hover {
    border-color: rgba(255, 255, 255, 0.14);
  }
}

.tile:active {
  transform: translateY(0);
  box-shadow: var(--tile-shadow);
}

.tile--disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.tile__icon {
  width: 40px;
  height: 40px;
  color: var(--fg);
  flex-shrink: 0;
}

.tile__label {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.tile__sublabel {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-top: -0.25rem;
}

.tile--soon .tile__label {
  color: var(--fg-muted);
}
