/* Página de acceso ("Soy estudiante / Soy del equipo ILC") -- estructura e
   interacción (selector deslizante, tarjeta centrada) portada de un diseño
   de referencia; colores y tipografía son los propios del proyecto, mismos
   tokens de portal.css (Barlow Condensed/Poppins, plum) -- no viene de
   ningún Artifact, así que este diseño es propio pero coherente. */

.acceso-hero {
  position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 48px 20px;
  background:
    radial-gradient(circle at 15% 10%, rgba(143, 109, 150, .22), transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(143, 109, 150, .16), transparent 50%),
    linear-gradient(160deg, #241726 0%, var(--accent-strong) 55%, var(--accent-dark) 100%);
}

.acceso-wrap { width: 100%; max-width: 440px; }

/* ---- Marca ---- */
.acceso-brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 30px; }
.acceso-seal { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; margin-bottom: 16px; box-shadow: 0 12px 30px -8px rgba(0,0,0,.5), 0 0 0 2px rgba(255,255,255,.16); }
.acceso-brand h1 {
  font-family: var(--font-display), sans-serif; font-weight: 600; font-size: 21px; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; margin: 0 0 8px;
}
.acceso-brand p { margin: 0; font-size: 13.5px; color: rgba(255,255,255,.72); font-style: italic; }

/* ---- Tarjeta ---- */
.acceso-card { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 30px 30px 28px; }

/* ---- Selector Estudiante / Equipo ---- */
.role-switch { position: relative; display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 4px; margin-bottom: 26px; }
.role-switch input { position: absolute; opacity: 0; pointer-events: none; }
.role-switch label {
  flex: 1; text-align: center; padding: 11px 8px; font-size: 13px; font-weight: 600; color: var(--ink-soft);
  border-radius: 10px; cursor: pointer; position: relative; z-index: 1; transition: color .25s ease; user-select: none;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.role-switch label svg { width: 15px; height: 15px; flex: none; }
.switch-highlight {
  position: absolute; top: 4px; left: 4px; width: calc(50% - 4px); height: calc(100% - 8px);
  background: var(--accent-gradient); border-radius: 10px; transition: transform .28s cubic-bezier(.65,0,.35,1); z-index: 0;
}
.acceso-card:has(#role-team:checked) .switch-highlight { transform: translateX(100%); }
.acceso-card:has(#role-student:checked) label[for="role-student"],
.acceso-card:has(#role-team:checked) label[for="role-team"] { color: var(--accent-ink); }

/* ---- Paneles ---- */
#student-panel, #team-panel { display: none; }
.acceso-card:has(#role-student:checked) #student-panel { display: flex; flex-direction: column; gap: 18px; }
.acceso-card:has(#role-team:checked) #team-panel { display: flex; flex-direction: column; gap: 18px; }

.panel-intro { text-align: center; }
.panel-intro h2 { font-family: var(--font-display), sans-serif; font-size: 19px; font-weight: 600; color: var(--ink); margin: 0 0 6px; }
.panel-intro p { margin: 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }

/* ---- Formulario real de WooCommerce (Soy estudiante) ---- */
#student-panel form.woocommerce-form-login { display: flex; flex-direction: column; gap: 16px; }
#student-panel .form-row { margin: 0 !important; padding: 0 !important; }
#student-panel .woocommerce-form-login label {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 6px;
}
#student-panel .woocommerce-form-login label .required { color: var(--critical); }
#student-panel .woocommerce-form-login input.input-text {
  appearance: none !important; width: 100% !important; padding: 12px 14px 12px 40px !important; border-radius: 12px !important;
  border: 1.5px solid var(--border) !important; font-size: 14px !important; font-family: inherit !important; color: var(--ink) !important;
  background-color: var(--surface-2) !important; background-repeat: no-repeat !important; background-position: 14px center !important; background-size: 16px 16px !important;
  outline: none; height: auto !important; transition: border-color .15s ease, background-color .15s ease;
}
#student-panel .woocommerce-form-login input.input-text:focus { border-color: var(--accent) !important; background-color: var(--surface) !important; }
#student-panel input#username {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%238B7488" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="4" width="20" height="16" rx="2"/><path d="M22 6 12 13 2 6"/></svg>') !important;
}
#student-panel input#password {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%238B7488" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>') !important;
}
#student-panel .woocommerce-form-login .clear { display: none; }
/* El botón real "Iniciar sesión" vive DENTRO del mismo <p> nativo que el
   checkbox "Recordarme" (WooCommerce los anida juntos) -- no se puede sacar
   a su propia fila sin sobreescribir el template completo, así que van uno
   al lado del otro en vez de forzar un layout que el DOM real no permite. */
#student-panel .woocommerce-form-login .form-row:not(.form-row-first):not(.form-row-last) {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
#student-panel .woocommerce-form-login__rememberme { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-soft); font-weight: 400; margin: 0; cursor: pointer; }
#student-panel .woocommerce-form-login__rememberme input { width: 15px; height: 15px; accent-color: var(--accent); }
#student-panel .lost_password { margin: 0; font-size: 13px; text-align: center; }
#student-panel .lost_password a { color: var(--accent); font-weight: 600; text-decoration: none; }
#student-panel .lost_password a:hover { text-decoration: underline; }

#student-panel .woocommerce-form-login__submit, #team-panel #team-submit {
  appearance: none; border: none; background: var(--accent-gradient); color: var(--accent-ink) !important;
  font-family: var(--font-body), sans-serif; font-weight: 700; font-size: 14px; letter-spacing: .01em;
  border-radius: 11px; cursor: pointer; padding: 10px 18px; flex: none;
  text-decoration: none; transition: filter .15s ease, transform .1s ease;
}
/* ::after (flecha) no funciona en <input type="submit"> -- solo el botón real
   (<button>) del formulario de WooCommerce la lleva; el del equipo (input
   nativo de wp_login_form()) queda sin flecha, limitación real del elemento. */
#student-panel .woocommerce-form-login__submit { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
#student-panel .woocommerce-form-login__submit::after {
  content: ""; width: 14px; height: 14px; flex: none;
  background: currentColor; -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg>') center / contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg>') center / contain no-repeat;
}
#student-panel .woocommerce-form-login__submit:hover, #team-panel #team-submit:hover { filter: brightness(1.08); }
#student-panel .woocommerce-form-login__submit:active, #team-panel #team-submit:active { transform: scale(.98); }

/* ---- "Soy del equipo ILC" -- login real de WordPress (wp_login_form()),
   mismo tratamiento visual que el formulario de WooCommerce del estudiante. ---- */
#team-panel form#team-loginform { display: flex; flex-direction: column; gap: 16px; }
#team-panel .login-username, #team-panel .login-password { margin: 0; }
#team-panel label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
#team-panel input.input {
  appearance: none; width: 100%; padding: 12px 14px 12px 40px; border-radius: 12px; box-sizing: border-box;
  border: 1.5px solid var(--border); font-size: 14px; font-family: inherit; color: var(--ink);
  background-color: var(--surface-2); background-repeat: no-repeat; background-position: 14px center; background-size: 16px 16px;
  outline: none; transition: border-color .15s ease, background-color .15s ease;
}
#team-panel input.input:focus { border-color: var(--accent); background-color: var(--surface); }
#team-panel #team-user-login {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%238B7488" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="4" width="20" height="16" rx="2"/><path d="M22 6 12 13 2 6"/></svg>');
}
#team-panel #team-user-pass {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%238B7488" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>');
}
#team-panel .login-remember { margin: 0; font-size: 13px; }
#team-panel .login-remember label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 400; color: var(--ink-soft); margin: 0; cursor: pointer; }
#team-panel .login-remember input { width: 15px; height: 15px; accent-color: var(--accent); }
#team-panel .login-submit { margin: 0; display: flex; }

/* ---- Nota del equipo ---- */
.team-note {
  display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5;
}
.team-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--accent); }

/* ---- Avisos nativos de WooCommerce (login fallido, etc.) ---- */
#student-panel ul.woocommerce-error, #student-panel ul.woocommerce-message {
  list-style: none; margin: 0; padding: 10px 14px; border-radius: 10px; font-size: 13px;
  background: var(--critical-soft); color: var(--critical);
}
#student-panel ul.woocommerce-message { background: var(--good-soft); color: var(--good); }
#student-panel ul.woocommerce-error li, #student-panel ul.woocommerce-message li { margin: 0; }

.acceso-footer { text-align: center; margin-top: 24px; font-size: 12px; color: rgba(255,255,255,.62); }
.acceso-footer a { color: #fff; font-weight: 600; text-decoration: underline; }

@media (max-width: 480px) {
  .acceso-card { padding: 24px 20px 22px; }
}
