:root {
  --navy: #082f49;
  --blue: #075985;
  --blue-light: #0284c7;
  --ice: #e0f2fe;
  --ink: #102a3a;
  --muted: #64748b;
  --line: #dbe7ee;
  --success: #0f766e;
  --danger: #be123c;
  --surface: rgba(255, 255, 255, 0.94);
  --shadow: 0 26px 70px rgba(2, 30, 52, 0.25);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #8cc6df url("../img/fondo-global-exchange.png") center / cover no-repeat fixed;
}

.shell {
  min-height: 100vh;
  padding: 20px clamp(18px, 4vw, 64px);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar, main, .footer {
  width: min(1180px, 100%);
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  text-align: left;
  text-decoration: none;
}

.brand-mark {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 16px rgba(3, 65, 99, 0.28));
}

.brand-name, .brand-tag { display: block; }
.brand-name {
  font-size: 20px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.035em;
}
.brand-tag {
  margin-top: 5px;
  color: rgba(8, 47, 73, 0.67);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.public-rates {
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.48);
  backdrop-filter: blur(10px);
  font-weight: 750;
  text-decoration: none;
  transition: background 0.18s, transform 0.18s;
}

.public-rates:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
}

.public-rates-mobile {
  display: none;
}

main {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.screen {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: enter 0.3s ease both;
}

@keyframes enter {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-card {
  width: min(440px, 100%);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-status {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.login-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  display: block;
  filter: drop-shadow(0 10px 16px rgba(3, 105, 161, 0.24));
}

.session-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--success), #14b8a6);
  box-shadow: 0 10px 24px rgba(3, 105, 161, 0.24);
  font-size: 25px;
  font-weight: 900;
}

.auth-heading {
  margin: 0 0 8px;
  text-align: center;
  font-size: 27px;
  letter-spacing: -0.04em;
}

.auth-copy {
  max-width: 370px;
  margin: 0 auto 25px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
}

.btn {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  box-shadow: 0 10px 22px rgba(3, 105, 161, 0.22);
}
.btn-primary:hover { box-shadow: 0 13px 27px rgba(3, 105, 161, 0.3); }
.btn-secondary { color: var(--blue); background: var(--ice); }
.btn-secondary:hover { background: #ccecff; }
.btn-block { width: 100%; }

.auth-links {
  margin: 19px 0 13px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.security-note {
  margin-top: 22px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  background: rgba(248, 250, 252, 0.8);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}
.security-icon { font-size: 15px; }

.user-info {
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  background: white;
}
.user-info-row {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid #edf2f6;
}
.user-info-row:last-child { border-bottom: 0; }
.user-info-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.user-info-row strong {
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.messages {
  width: min(440px, calc(100% - 30px));
  position: fixed;
  top: 90px;
  left: 50%;
  z-index: 10;
  transform: translateX(-50%);
}
.message {
  margin-bottom: 10px;
  padding: 13px 16px;
  border-radius: 12px;
  color: white;
  background: #0f172a;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.message-success { background: var(--success); }
.message-error { background: var(--danger); }

.footer { margin-top: 20px; text-align: center; }
.footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(2, 30, 52, 0.5);
}

@media (max-width: 800px) {
  body { background-attachment: scroll; }
  .shell { padding: 18px 14px 28px; }
  .brand-tag { display: none; }
  .brand-mark { width: 48px; height: 48px; }
  .public-rates { padding: 9px 12px; font-size: 12px; }
  main { margin-top: 20px; }
}

@media (max-width: 520px) {
  .auth-card { padding: 24px 18px; border-radius: 18px; }
  .auth-heading { font-size: 24px; }
  .auth-copy { font-size: 13px; }
  .brand-name { font-size: 17px; }
  .public-rates-desktop { display: none; }
  .public-rates-mobile {
    width: fit-content;
    margin: 18px auto 0;
    display: block;
    color: var(--navy);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 8px 22px rgba(2, 30, 52, 0.16);
    text-align: center;
  }
  .messages { top: 70px; }
  .login-status {
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    position: absolute;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}
.messages {
    width: min(100%, 520px);
    margin: 0 auto 1rem;
}

.message {
    padding: 0.875rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    color: #1f2937;
    text-align: center;
}

.message-error {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #991b1b;
}

.message-success {
    border-color: #86efac;
    background: #f0fdf4;
    color: #166534;
}