:root {
    --bg: #f6f8fb;
    --surface: rgba(255, 255, 255, 0.84);
    --surface-strong: #ffffff;
    --text: #152033;
    --muted: #60708a;
    --line: rgba(21, 32, 51, 0.09);
    --primary: #2b5cff;
    --primary-soft: rgba(43, 92, 255, 0.10);
    --accent: #12b886;
    --shadow: 0 20px 50px rgba(25, 38, 68, 0.10);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
    radial-gradient(circle at top left, rgba(43, 92, 255, 0.12), transparent 26%),
    radial-gradient(circle at top right, rgba(18, 184, 134, 0.10), transparent 20%),
    linear-gradient(180deg, #fbfcff 0%, var(--bg) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

button, input {
    font: inherit;
}

.container {
    width: min(calc(100% - 32px), var(--max));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(18px);
    background: rgba(246, 248, 251, 0.72);
    border-bottom: 1px solid rgba(21, 32, 51, 0.06);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #7b61ff);
    color: white;
    display: grid;
    place-items: center;
    box-shadow: 0 10px 24px rgba(43, 92, 255, 0.26);
    font-size: 18px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.brand-text strong {
    font-size: 1.05rem;
    font-weight: 800;
}

.brand-text span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.83rem;
    font-weight: 600;
}

.main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px 0;
}

.login-card {
    position: relative;
    overflow: hidden;
    width: min(100%, 560px);
    border: 1px solid rgba(255, 255, 255, 0.82);
    background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.78) 100%);
    box-shadow: var(--shadow);
    border-radius: 32px;
    padding: 28px;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: auto -60px -80px auto;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(43, 92, 255, 0.18), transparent 65%);
    pointer-events: none;
}

.login-panel {
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,0.88);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 10px 24px rgba(21, 32, 51, 0.05);
    padding: 24px;
}

.card-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.84rem;
    font-weight: 800;
}

.login-panel h2 {
    margin: 0 0 10px;
    font-size: clamp(1.55rem, 2vw, 2rem);
    letter-spacing: -0.04em;
}

.login-panel > p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    font-size: 0.98rem;
}

.divider {
    height: 1px;
    background: var(--line);
    margin: 20px 0;
}

.field-wrap {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.field-wrap label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.field {
    width: 100%;
    border: 1px solid var(--line);
    background: white;
    border-radius: 16px;
    padding: 15px 16px;
    font-size: 0.98rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field:focus {
    border-color: rgba(43, 92, 255, 0.45);
    box-shadow: 0 0 0 4px rgba(43, 92, 255, 0.10);
}

.password-wrap {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 10px;
}

.password-toggle:hover {
    background: rgba(21, 32, 51, 0.05);
    color: var(--text);
}

.row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 6px 0 18px;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.93rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.check input {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.link {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.93rem;
}

.link:hover {
    text-decoration: underline;
}

.btn {
    border: none;
    cursor: pointer;
    border-radius: 14px;
    padding: 14px 18px;
    font-weight: 700;
    font-size: 0.97rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), #6a5cff);
    color: white;
    box-shadow: 0 14px 28px rgba(43, 92, 255, 0.22);
}

.btn-secondary {
    width: 100%;
    background: white;
    color: var(--text);
    border: 1px solid var(--line);
}

.auth-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.auth-separator::before,
.auth-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.helper-text {
    margin-top: 16px;
    color: var(--muted);
    font-size: 0.93rem;
    line-height: 1.65;
    text-align: center;
}

.helper-text a {
    color: var(--primary);
    font-weight: 700;
}

.helper-text a:hover {
    text-decoration: underline;
}

.notice {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(18, 184, 134, 0.08);
    border: 1px solid rgba(18, 184, 134, 0.14);
    color: #116b51;
    font-size: 0.92rem;
    font-weight: 600;
    display: none;
}

.notice.visible {
    display: block;
}

footer {
    padding: 18px 0 46px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 720px) {
    .main {
    padding: 24px 0;
    }

    .login-card {
    border-radius: 26px;
    padding: 18px;
    }
}

.err_msg {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(224, 49, 49, 0.08);
  border: 1px solid rgba(224, 49, 49, 0.18);
  color: #c92a2a;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.5;
}

/* Para evitar doble estilo en el <p> interno */
.err_msg p {
  margin: 0;
}