:root {
  --brand-blue: #385e9d;
  --brand-blue-dark: #244879;
  --brand-yellow: #ffd500;
  --ink: #233247;
  --muted: #65758b;
  --surface: #ffffff;
  --line: #d9e1ee;
  --soft: #f4f6fa;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--soft);
}

button,
input {
  font: inherit;
}

.brand-logo {
  display: block;
  width: clamp(110px, 13vw, 200px);
  height: auto;
}

.login-page {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 72px 20px 56px;
  background-image: url("/images/FondoLogin.png");
  background-position: bottom center;
  background-repeat: no-repeat;
  background-size: cover;
}

.login-logo {
  position: absolute;
  top: 18px;
  left: 24px;
}

.login-panel {
  width: min(100%, 460px);
}

.login-panel h1 {
  margin: 0 0 18px;
  color: var(--brand-blue);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.2;
  text-align: center;
}

.login-form {
  display: grid;
  gap: 8px;
}

.login-form label {
  color: var(--brand-blue);
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 999px;
  outline: none;
}

.login-form input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(56, 94, 157, 0.15);
}

.otp-inputs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.login-form .otp-input {
  min-height: 50px;
  padding: 0;
  border-radius: 12px;
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
}

.login-form span,
.validation-summary {
  min-height: 18px;
  color: var(--danger);
  font-size: 0.86rem;
}

.validation-summary ul {
  margin: 0;
  padding-left: 18px;
}

.primary-button,
.chat-composer button,
.icon-button {
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  justify-self: center;
  min-width: 148px;
  min-height: 42px;
  margin-top: 8px;
  padding: 0 26px;
  color: #ffffff;
  background: var(--brand-blue);
  border-radius: 999px;
}

.primary-button:hover,
.chat-composer button:hover,
.icon-button:hover {
  background: var(--brand-blue-dark);
}

.as-link {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.alert {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #eef4ff;
  color: var(--brand-blue-dark);
}

.login-footer,
.home-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px;
  font-weight: 700;
  text-align: center;
}

.login-footer {
  color: #ffffff;
}

.home-page {
  position: relative;
  min-height: 100vh;
  padding-bottom: 54px;
  overflow-x: hidden;
  background: #ffffff;
}

.home-page::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: min(42vw, 360px);
  background-image: url("/images/FondoHome.png");
  background-position: top center;
  background-repeat: no-repeat;
  background-size: cover;
  z-index: 0;
}

.home-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1260px);
  margin: 0 auto;
  padding: 28px 24px;
}

.home-header {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.home-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.user-actions h1 {
  margin: 0;
  color: var(--brand-blue);
  font-size: clamp(1.3rem, 3vw, 2.5rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-align: right;
}

.icon-button {
  min-width: 64px;
  min-height: 38px;
  padding: 0 14px;
  color: #ffffff;
  background: var(--brand-blue);
  border-radius: 999px;
}

.support-copy {
  justify-self: end;
  width: min(100%, 520px);
  margin: 0;
  padding: 16px 20px;
  color: #ffffff;
  line-height: 1.5;
  background: var(--brand-blue);
  border-radius: 8px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
  gap: 24px;
}

.details-column {
  display: grid;
  gap: 24px;
}

.info-card {
  background: var(--surface);
  border: 1px solid rgba(35, 50, 71, 0.08);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(33, 45, 65, 0.08);
}

.info-card h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.customer-card {
  min-height: 300px;
  padding: 26px;
  color: #ffffff;
  background: var(--brand-blue);
}

.phone-card {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 24px;
  min-height: 300px;
  padding: 26px;
  align-items: center;
}

.phone-image {
  width: min(100%, 150px);
  height: auto;
  justify-self: center;
  border-radius: 8px;
}

.phone-details {
  min-width: 0;
}

.phone-details h2,
.phone-card dt,
.phone-card dd {
  color: var(--brand-blue);
}

.info-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
  margin: 22px 0 0;
}

.info-list.compact {
  gap: 14px 18px;
}

.info-list > div {
  min-width: 0;
}

.info-list dt {
  margin-bottom: 4px;
  font-size: 0.93rem;
  opacity: 0.86;
}

.info-list dd {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.client-info-list {
  gap: 18px 20px;
}

.client-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.client-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  background: transparent;
}

.client-icon img {
  display: block;
  width: 24px;
  height: 24px;
}

.color-value {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-dot {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 1px solid var(--brand-blue);
  border-radius: 999px;
}

.chat-card {
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) auto;
  height: 665px;
  padding: 24px;
}

.chat-heading {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.support-badge {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  background: var(--brand-yellow);
  border-radius: 999px;
}

.support-badge img {
  width: 30px;
  height: 30px;
}

.chat-heading strong {
  padding: 6px 22px;
  color: var(--brand-yellow);
  background: var(--brand-blue);
  border-radius: 999px;
}

.chat-heading h2,
.chat-heading p {
  margin: 0;
  color: var(--brand-blue);
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  margin: 22px 0;
  padding: 16px;
  overflow-y: auto;
  background: #f5f5f5;
  border-radius: 8px;
}

.chat-message {
  max-width: min(76%, 420px);
  padding: 10px 14px;
  line-height: 1.4;
  border-radius: 8px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-message.user {
  align-self: flex-end;
  color: var(--ink);
  background: #e9edf4;
}

.chat-message.agent {
  align-self: flex-start;
  color: #ffffff;
  background: var(--brand-blue);
}

.chat-message.status {
  align-self: center;
  color: var(--muted);
  background: transparent;
}

.chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 6px;
  background: #f5f5f5;
  border-radius: 999px;
}

.chat-composer input {
  min-width: 0;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  outline: none;
}

.chat-composer input:focus {
  border-color: var(--brand-blue);
}

.chat-composer button {
  min-width: 86px;
  min-height: 44px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--brand-yellow);
  border-radius: 999px;
}

.chat-composer button:disabled {
  cursor: default;
  background: #c9d1df;
}

.home-footer {
  color: var(--brand-blue);
  background: #ffffff;
  box-shadow: 0 -2px 10px rgba(35, 50, 71, 0.08);
}

.error-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.error-card {
  display: grid;
  gap: 14px;
  width: min(100%, 460px);
  padding: 24px;
}

.error-card h1,
.error-card p {
  margin: 0;
}

@media (max-width: 980px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .chat-card {
    height: min(665px, 80vh);
  }
}

@media (max-width: 700px) {
  .home-shell {
    padding: 20px 14px;
  }

  .home-heading {
    align-items: flex-start;
  }

  .user-actions {
    align-items: flex-end;
    flex-direction: column;
  }

  .support-copy {
    justify-self: stretch;
  }

  .phone-card {
    grid-template-columns: 1fr;
  }

  .info-list {
    grid-template-columns: 1fr;
  }

  .chat-card {
    padding: 18px;
  }

  .chat-composer {
    border-radius: 18px;
  }

  .chat-composer button {
    min-width: 72px;
  }

  .otp-inputs {
    gap: 6px;
  }

  .login-form .otp-input {
    min-height: 46px;
    font-size: 1.2rem;
  }
}

.home-loader {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.animate-logo {
  width: 120px;
  height: 120px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.animate-logo-inner {
  display: inline-flex;
  animation: logoPulse 3s ease-in-out infinite;
}

.animate-logo-img {
  width: 64px;
  height: 64px;
  position: relative;
  z-index: 2;
}

.animate-logo-border {
  position: absolute;
  border-color: rgba(30, 74, 126, 0.24);
  border-style: solid;
}

.animate-logo-border-sm {
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  border-width: 3px;
  animation: borderSmall 3.2s linear infinite;
}

.animate-logo-border-lg {
  width: 100%;
  height: 100%;
  border-width: 8px;
  animation: borderLarge 3.2s linear infinite;
}

@keyframes logoPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }

  25%, 50% {
    transform: scale(.9);
    opacity: .48;
  }

  75% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes borderSmall {
  0%, 100% {
    transform: scale(1.6) rotate(270deg);
    opacity: .25;
    border-radius: 25%;
  }

  25%, 50% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    border-radius: 25%;
  }

  75% {
    transform: scale(1.6) rotate(270deg);
    opacity: 1;
    border-radius: 50%;
  }
}

@keyframes borderLarge {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    border-radius: 25%;
  }

  25%, 50% {
    transform: scale(1.2) rotate(270deg);
    opacity: .25;
    border-radius: 25%;
  }

  75% {
    transform: scale(1) rotate(0deg);
    opacity: .25;
    border-radius: 50%;
  }
}
