:root {
  --recordati-red: #d83b43;
  --recordati-teal: #0ea5b7;
  --recordati-ink: #3d4046;
  --recordati-muted: #7b7f86;
  --recordati-panel: rgba(255, 255, 255, 0.86);
  --recordati-line: rgba(61, 64, 70, 0.16);
  --recordati-shadow: 0 24px 60px rgba(61, 64, 70, 0.12);
}

html { font-size: 16px; min-height: 100%; }
body.recordati-app {
  min-height: 100vh;
  margin: 0;
  color: var(--recordati-ink);
  font-family: "Noto Sans", "Segoe UI", "Helvetica Neue", sans-serif;
  position: relative;
}

.app-figure {
  position: fixed;
  top: 0;
  right: 0;
  width: min(44vw, 680px);
  height: 100vh;
  background: url('/images/branding/BG-agentes.jpg') right bottom/contain no-repeat;
  opacity: .92;
  pointer-events: none;
}

.app-header, .app-main, .app-footer { position: relative; z-index: 1; }
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2rem 2rem .5rem;
}
.app-header__actions {
  display: flex;
  align-items: center;
  min-height: 58px;
  margin-left: auto;
  margin-right: 1rem;
}

.brand-link { text-decoration: none; color: inherit; display: inline-flex; flex-direction: column; gap: .15rem; }
.brand-mark { display: inline-flex; align-items: center; gap: 1rem; }
.brand-mark img:first-child { height: 58px; width: auto; }
.brand-main { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 300; letter-spacing: -.08em; line-height: 1; }
.brand-main span { color: var(--recordati-red); font-weight: 700; }
.brand-sub { color: var(--recordati-muted); font-size: 1.05rem; }
.brand-sub strong { color: var(--recordati-red); }

.app-header__session { display: flex; align-items: center; gap: 1rem; background: var(--recordati-panel); padding: .75rem 1rem; border-radius: 999px; box-shadow: var(--recordati-shadow); }
.session-user { font-weight: 600; }
.session-logout { color: var(--recordati-red); text-decoration: none; font-weight: 700; }

.app-main { padding: 0 2rem 0; }
.app-footer {
  padding: .5rem 2rem 1.75rem;
  color: var(--recordati-muted);
  font-size: .78rem;
  max-width: 640px;
  padding-bottom: 10px;
}
.app-footer__brand img { height: 32px; width: auto; margin-bottom: .5rem; }
.app-footer__copy { line-height: 1.35; text-transform: uppercase; }

.cookie-banner {
  position: fixed;
  left: 2rem;
  right: 2rem;
  bottom: 1.5rem;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1rem 1.2rem;
  border-radius: 1rem;
  background: rgba(61, 64, 70, 0.95);
  color: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  transform: translateY(16px);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}

.cookie-banner--visible {
  transform: translateY(0);
  opacity: 1;
}

.cookie-banner__content {
  display: grid;
  gap: .25rem;
}

.cookie-banner__title {
  font-size: 1rem;
  font-weight: 700;
}

.cookie-banner__text {
  margin: 0;
  font-size: .95rem;
  line-height: 1.4;
  color: rgba(255,255,255,.92);
}

.cookie-banner__actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.cookie-banner__accept {
  min-width: 132px;
  border-radius: .85rem;
  background: #008B94;
  border-color: #008B94;
}

.auth-shell, .landing-shell, .agent-shell, .admin-shell, .simple-auth-card {
  width: min(1120px, calc(100vw - 4rem));
  margin: 0 auto;
}

.auth-shell { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: start; min-height: 68vh; }
.auth-brand { max-width: 42rem; }
.auth-login-column { display: grid; gap: 1.0rem; max-width: 430px; }
.auth-shell__spacer { min-height: 1px; }
.auth-brand__panel {
  max-width: none;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  backdrop-filter: none;
}
.auth-intro { font-size: 1.35rem; margin-top: 2rem; }
.auth-brand__panel .auth-intro { margin-top: 0; font-size: 20px; line-height: 1.22; letter-spacing: -.02em; max-width: 100%; width: 100%; }
.auth-intro__highlight { color: #b71b20; font-weight: 700; }
.auth-note { color: var(--recordati-muted); font-size: 15px; line-height: 1.22; max-width: 100%; width: 100%; }
.auth-card, .simple-auth-card, .agent-conversation, .stat-card, .agent-card, .admin-link-card, .report-chart {
  background: var(--recordati-panel);
  backdrop-filter: blur(6px);
  border: 1px solid var(--recordati-line);
  box-shadow: var(--recordati-shadow);
  border-radius: 1.5rem;
}

.auth-card, .simple-auth-card { padding: 1.8rem; }
.auth-card--login {
  background: #b1b1b1;
  border: none;
  box-shadow: none;
  border-radius: 1rem;
  padding: 1.35rem 1.25rem 1.2rem;
}
.auth-card__icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}
.auth-card__icon img { width: 74px; height: auto; }
.auth-card h1, .simple-auth-card h1, .landing-copy h1, .agent-hero h1, .admin-shell h1 { font-size: clamp(2rem, 4vw, 3.2rem); margin-bottom: 1rem; letter-spacing: -.04em; }
.auth-field {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: .7rem;
  padding: 0 .9rem;
  border: 1px solid rgba(61,64,70,.08);
  border-radius: .85rem;
  background: #efefef;
  min-height: 35px;
}
.auth-card--login form { display: grid; gap: 10px; }
.auth-field img { width: 16px; height: 16px; opacity: .75; }
.auth-field input {
  border: none;
  background: transparent;
  padding: 0;
  height: 35px;
  line-height: 35px;
}
.auth-field input:focus { outline: none; box-shadow: none; }
.auth-field + .text-danger { margin-top: -6px; }
.forgot-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  text-decoration: none;
  color: #fff;
}
.forgot-link img { width: 14px; height: 14px; opacity: .75; }
.forgot-link span { color: #fff; }

label { display: block; font-weight: 600; margin: 1rem 0 .4rem; }
input, select, textarea {
  width: 100%;
  border: 1px solid rgba(61,64,70,.2);
  border-radius: .85rem;
  padding: .9rem 1rem;
  background: rgba(255,255,255,.92);
}

.auth-actions, .filters-row, .list-header, .agent-actions, .agent-conversation__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.remember-check, .checkbox-line { display: inline-flex; gap: .6rem; align-items: center; font-weight: 500; }
.remember-check input, .checkbox-line input { width: auto; }
.remember-check span { color: #fff; }
.auth-submit { width: 100%; margin-top: .8rem; border-radius: .9rem; padding: 0 1rem; height: 35px; line-height: 35px; background: var(--recordati-teal); border-color: var(--recordati-teal); }

.page-login {
  background-color: #fff;
  background-image: url('/images/branding/BG-login.jpg');
  background-repeat: no-repeat;
  background-position: right bottom;
}

.page-login .app-figure { display: none; }
.page-login .app-main {
  padding-top: .25rem;
  min-height: calc(80vh - 170px);
}
.page-login .auth-shell {
  grid-template-columns: 1fr;
  gap: 1rem;
  min-height: 58vh;
  align-items: start;
  margin: 0;
}
.page-login .auth-login-column {
  width: min(1000px, 100%);
  max-width: none;
}
.page-login .auth-brand {
  width: 1000px;
  max-width: none;
}
.page-login .auth-card--login { width: 430px; }

.landing-shell { min-height: 68vh; }
.landing-hero { margin-bottom: 1.75rem; }
.landing-copy {
  max-width: 40rem;
  min-height: auto;
  padding: .5rem 0 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: block;
}
.landing-kicker, .landing-hero__art { display: none; }
.landing-copy h1 { margin-bottom: .4rem; }
.landing-copy p { max-width: 42rem; font-size: 1.02rem; }
.agent-grid { display: grid; grid-template-columns: repeat(3, minmax(280px, 300px)); gap: 2rem; max-width: 980px; }
.agent-card { overflow: hidden; border-radius: 4px; background: #EBEBEB; }
.agent-card__media { min-height: 124px; background: #fff; display: grid; place-items: center; border-bottom: 1px solid rgba(61,64,70,.28); padding: 1rem; }
.agent-card__image {
  max-width: min(100%, 220px);
  max-height: 76px;
  object-fit: contain;
  border-radius: 0;
}
.agent-card__logo { font-size: 2.4rem; font-weight: 700; letter-spacing: -.05em; }
.agent-card__content { padding: 1.2rem; display: grid; gap: 1rem; min-height: 180px; background: #EBEBEB; }
.agent-card__title { font-size: 1.15rem; letter-spacing: -.02em; }
.agent-card .btn { justify-self: start; background: #008B94; border-color: #008B94; }

.page-platform .landing-shell {
  margin: 0;
  width: min(660px, 100%);
}

.page-agent .app-figure { display: none; }
.page-agent .agent-shell {
  margin: 0 auto;
  width: min(980px, 100%);
  min-height: 68vh;
}

.back-link { color: var(--recordati-muted); text-decoration: none; font-weight: 600; }
.back-link--header {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--recordati-ink);
  text-decoration: none;
}
.agent-shell { min-height: 68vh; }
.agent-hero { text-align: center; margin: 0 auto 1rem; max-width: 52rem; }
.agent-subtitle { color: var(--recordati-muted); font-size: 1.35rem; margin-bottom: .15rem; }
.agent-hero__title { color: var(--recordati-red); font-weight: 800; }
.agent-voice-stage { display: flex; justify-content: center; margin-top: .1rem; }
.agent-voice-video-shell {
  position: relative;
  width: 360px;
  max-width: min(72vw, 360px);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  margin-top: -50px;
  margin-bottom: -40px;
}

.agent-voice-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
}

.agent-voice-orb {
  position: relative;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 32%, var(--avatar-accent, var(--recordati-teal)) 0 11%, transparent 12%),
    radial-gradient(circle at 68% 36%, rgba(216,59,67,.95) 0 13%, transparent 14%),
    radial-gradient(circle at 47% 52%, rgba(61,64,70,.88) 0 17%, transparent 18%),
    radial-gradient(circle at 62% 64%, var(--avatar-accent, var(--recordati-teal)) 0 10%, transparent 11%),
    radial-gradient(circle at 40% 72%, rgba(216,59,67,.86) 0 12%, transparent 13%),
    radial-gradient(circle at center, rgba(255,255,255,.98) 0 24%, rgba(255,255,255,0) 25%);
  box-shadow: inset 0 0 70px rgba(255,255,255,.9), 0 12px 34px rgba(61,64,70,.1);
}

.agent-voice-orb::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 10px solid rgba(255,255,255,.45);
}

.voice-waves {
  position: absolute;
  inset: -20px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.wave {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(14,165,183,.18);
  transform: scale(.88);
  opacity: 0;
}

.wave-1 { width: 104%; height: 104%; }
.wave-2 { width: 118%; height: 118%; }
.wave-3 { width: 132%; height: 132%; }

.agent-voice-orb.speaking .wave {
  animation: wavePulse 1.5s ease-out infinite;
}

.agent-voice-orb.speaking .wave-2 { animation-delay: .2s; }
.agent-voice-orb.speaking .wave-3 { animation-delay: .4s; }

@keyframes wavePulse {
  0% { transform: scale(.92); opacity: .15; }
  70% { transform: scale(1.06); opacity: .45; }
  100% { transform: scale(1.14); opacity: 0; }
}

.agent-avatar {
  width: 280px; height: 280px; margin: 1rem auto 0; border-radius: 50%;
  background:
    radial-gradient(circle at 30% 32%, var(--avatar-accent, var(--recordati-teal)) 0 11%, transparent 12%),
    radial-gradient(circle at 68% 36%, rgba(216,59,67,.95) 0 13%, transparent 14%),
    radial-gradient(circle at 47% 52%, rgba(61,64,70,.88) 0 17%, transparent 18%),
    radial-gradient(circle at 62% 64%, var(--avatar-accent, var(--recordati-teal)) 0 10%, transparent 11%),
    radial-gradient(circle at 40% 72%, rgba(216,59,67,.86) 0 12%, transparent 13%),
    radial-gradient(circle at center, rgba(255,255,255,.98) 0 24%, rgba(255,255,255,0) 25%);
  box-shadow: inset 0 0 70px rgba(255,255,255,.9), 0 12px 34px rgba(61,64,70,.1);
  position: relative;
}

.agent-avatar::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 10px solid rgba(255,255,255,.45);
}

.agent-actions { justify-content: center; margin-bottom: .55rem; flex-wrap: wrap; gap: .8rem; }
.agent-chip, .agent-mic {
  border: none; border-radius: 999px; padding: .95rem 1.45rem; font-size: 1.1rem;
  box-shadow: 0 10px 22px rgba(61, 64, 70, .10);
}
.agent-chip { background: #d9d9e4; color: var(--recordati-ink); }
.agent-chip--secondary { background: rgba(216,59,67,.12); color: var(--recordati-red); }
.agent-mic {
  background: var(--recordati-teal);
  color: white;
  min-width: 152px;
  height: 92px;
  padding: 0 1.15rem;
  border: 6px solid rgba(255,255,255,.92);
  text-align: center;
  line-height: 1.1;
}
.agent-status { text-align: center; margin-bottom: 1rem; color: var(--recordati-muted); }
.agent-status--bottom { font-size: .95rem; margin-top: -.4rem; }
.agent-conversation {
  position: fixed;
  top: 110px;
  right: 0;
  bottom: 0;
  width: min(460px, calc(100vw - 1.25rem));
  max-width: none;
  margin: 0;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,.96);
  border-radius: 1.25rem 0 0 0;
  z-index: 20;
  box-shadow: -18px 0 40px rgba(61, 64, 70, .16);
}
.agent-conversation__header {
  justify-content: space-between;
  margin-bottom: .5rem;
}
.agent-conversation__close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #d9d9e4;
  color: var(--recordati-ink);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.agent-conversation__log {
  min-height: 260px;
  height: calc(100vh - 210px);
  overflow: auto;
  white-space: normal;
  padding-right: .25rem;
}
.agent-line { margin-bottom: .9rem; }
.agent-line__content p { margin: 0 0 .65rem; }
.agent-line__content p:last-child { margin-bottom: 0; }
.agent-line__content ol,
.agent-line__content ul { margin: .3rem 0 .75rem 1.35rem; padding: 0; }
.agent-line__content li { margin-bottom: .35rem; }
.agent-line__content code {
  display: inline-block;
  padding: .08rem .35rem;
  border-radius: .45rem;
  background: rgba(61, 64, 70, .08);
  font-family: Consolas, "Courier New", monospace;
  font-size: .92em;
}
.agent-chat-form { display: flex; gap: .8rem; max-width: 760px; margin: 0 auto; position: relative; }
.agent-chat-form .btn-primary {
  background: #0dcaf0;
  border-color: #0dcaf0;
}
.agent-chat-form .btn-primary:hover,
.agent-chat-form .btn-primary:focus {
  background: #0bb5d8;
  border-color: #0bb5d8;
}
.agent-chat-form__close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--recordati-red);
  color: white;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.admin-shell { display: grid; gap: 1.5rem; }
.admin-toolbar { display: flex; justify-content: flex-start; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.stat-card { padding: 1.2rem; display: grid; gap: .5rem; }
.stat-card span { color: var(--recordati-muted); }
.stat-card strong { font-size: 2rem; }
.admin-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.admin-link-card { padding: 1.2rem 1.4rem; text-decoration: none; color: var(--recordati-ink); font-weight: 700; }
.recordati-form {
  display: grid;
  gap: 1rem;
  max-width: 820px;
  padding: 1.5rem;
  background: var(--recordati-panel);
  border: 1px solid var(--recordati-line);
  border-radius: 1.25rem;
  box-shadow: var(--recordati-shadow);
}
.form-row { display: grid; gap: .35rem; }
.form-actions { display: flex; justify-content: flex-start; margin-top: .5rem; }
.recordati-table { background: var(--recordati-panel); border-radius: 1rem; overflow: hidden; }
.filters-row { flex-wrap: wrap; }
.filters-row input, .filters-row select { width: auto; min-width: 180px; }
.two-column-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.report-chart { min-height: 260px; padding: 1rem; }

.text-danger, .validation-summary-errors { color: #b42318; }
.text-success { color: #067647; }

.page-forgot-password .simple-auth-card--forgot-password {
  width: min(520px, calc(100vw - 4rem));
}

.page-reset-password .simple-auth-card--reset-password {
  width: min(520px, calc(100vw - 4rem));
}

.simple-auth-card--forgot-password h1,
.simple-auth-card--reset-password h1 {
  font-size: 2rem;
}

.simple-auth-card__submit {
  background: #0dcaf0;
  border-color: #0dcaf0;
}

.simple-auth-card__submit:hover,
.simple-auth-card__submit:focus {
  background: #0bb5d8;
  border-color: #0bb5d8;
}

@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; min-height: auto; }
  .app-figure { opacity: .22; width: 65vw; background-position: right top; }
  .two-column-layout { grid-template-columns: 1fr; }
  .agent-grid { grid-template-columns: 1fr 1fr; }
  .page-login .auth-shell { grid-template-columns: 1fr; }
  .page-login .auth-shell__spacer { display: none; }
  .page-login .auth-brand,
  .page-login .auth-login-column,
  .page-login .auth-card--login { width: 100%; max-width: 100%; }
}

@media (max-width: 720px) {
  .app-header, .app-main, .app-footer { padding-left: 1rem; padding-right: 1rem; }
  .auth-shell, .landing-shell, .agent-shell, .admin-shell, .simple-auth-card { width: calc(100vw - 2rem); }
  .app-header { flex-direction: column; gap: 1rem; }
  .app-header__actions { margin: 0; min-height: auto; }
  .agent-chat-form { flex-direction: column; }
  .agent-avatar { width: 220px; height: 220px; }
  .agent-grid { grid-template-columns: 1fr; max-width: 320px; }
  .brand-mark img:first-child { height: 48px; }
  .app-footer__brand img { height: 28px; }
  .agent-conversation {
    top: 96px;
    width: calc(100vw - 1rem);
    border-radius: 1rem 0 0 0;
  }
  .agent-conversation__log { height: calc(100vh - 196px); }
  .page-forgot-password .simple-auth-card--forgot-password,
  .page-reset-password .simple-auth-card--reset-password { width: calc(100vw - 2rem); }
  .cookie-banner {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    flex-direction: column;
    align-items: stretch;
  }
  .cookie-banner__actions { width: 100%; }
  .cookie-banner__accept { width: 100%; }
}
