/* Finorys Workplace — portail cloud */
:root {
  --bg-1: #e8f0ff;
  --bg-2: #f0e8ff;
  --bg-3: #fafbff;
  --text: #1a1d26;
  --text-muted: #5c6370;
  --shadow: 0 8px 32px rgba(26, 29, 38, 0.08);
  --shadow-soft: 0 4px 20px rgba(26, 29, 38, 0.06);
  --radius-pill: 999px;
  --radius-card: 20px;
  --chat: #7c3aed;
  --mail: #0ea5e9;
  --drive: #f97316;
  --visio: #10b981;
  --erp: #0e7490;
  --avatar: linear-gradient(135deg, #84cc16, #22c55e);
  --header-h: 64px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: linear-gradient(
      145deg,
      var(--bg-1) 0%,
      var(--bg-2) 45%,
      var(--bg-3) 100%
    )
    fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem 0 1.5rem;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-soft);
  flex-shrink: 0;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
  max-width: 100%;
  max-height: 100%;
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  box-shadow: var(--shadow-soft);
}

.icon-btn:hover {
  background: #fff;
  color: var(--text);
  transform: translateY(-1px);
}

.icon-btn:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.header-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--avatar);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  margin-left: 0.25rem;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: var(--shadow-soft);
}

/* Main */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(2rem, 8vw, 4rem) 1.25rem 4rem;
  text-align: center;
}

.hero-avatar {
  width: clamp(72px, 18vw, 96px);
  height: clamp(72px, 18vw, 96px);
  border-radius: var(--radius-pill);
  background: var(--avatar);
  color: #fff;
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2rem);
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  box-shadow: var(--shadow);
  border: 4px solid rgba(255, 255, 255, 0.95);
}

.hero-name {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero-sub {
  margin: 0 0 1.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Search */
.search-wrap {
  max-width: 420px;
  margin: 0 auto 2.25rem;
  position: relative;
}

.search-wrap svg {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
}

#app-search {
  width: 100%;
  padding: 0.95rem 1.25rem 0.95rem 3rem;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, background 0.2s;
}

#app-search::placeholder {
  color: #9ca3af;
}

#app-search:focus {
  outline: none;
  background: #fff;
  box-shadow: 0 8px 40px rgba(99, 102, 241, 0.15);
}

/* App grid */
.apps-label {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-left: 0.25rem;
}

.app-grid {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(0.65rem, 3vw, 1.35rem);
  width: 100%;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.15rem 0 0.35rem;
  scrollbar-width: thin;
}

.app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  max-width: 112px;
  transition: transform 0.2s;
}

.app-tile:hover .app-icon {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 28px rgba(26, 29, 38, 0.12);
}

.app-tile:focus-visible {
  outline: none;
}

.app-tile:focus-visible .app-icon {
  outline: 3px solid #6366f1;
  outline-offset: 3px;
}

.app-tile[hidden] {
  display: none !important;
}

.app-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s, box-shadow 0.2s;
}

.app-icon svg {
  width: 32px;
  height: 32px;
  max-width: 100%;
  max-height: 100%;
}

.app-icon.chat {
  background: linear-gradient(145deg, #8b5cf6, var(--chat));
}

.app-icon.mail {
  background: linear-gradient(145deg, #38bdf8, var(--mail));
}

.app-icon.drive {
  background: linear-gradient(145deg, #fb923c, var(--drive));
}

.app-icon.visio {
  background: linear-gradient(145deg, #34d399, var(--visio));
}

.app-icon.erp {
  background: linear-gradient(145deg, #22d3ee, var(--erp));
}

.sso-foot {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.sso-foot a {
  color: #4f46e5;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sso-foot a:hover {
  color: #4338ca;
}

.app-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

/* FAB optional */
.fab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-pill);
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  display: grid;
  place-items: center;
  transition: transform 0.2s;
}

.fab:hover {
  transform: scale(1.05);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 29, 38, 0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: #fff;
  border-radius: var(--radius-card);
  padding: 1.5rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  text-align: left;
}

.modal h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.modal label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.modal input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 1rem;
  font: inherit;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.btn {
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
}

.btn-ghost {
  background: #f3f4f6;
  color: var(--text);
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
