/*Registre del log in */

#go-register {
  margin-top: 1.2rem;
  display: inline-block;
}

/*Inici sessio al Registre*/

#go-login {
  margin-top: 1.2rem;
  display: inline-block;
}

/*Al formulari de registre*/

#registre-btn {
  margin-top: 20px;  /* Pots ajustar aquest valor segons et convingui */
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 44px;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--color-subtext);
  transition: var(--transition);
}

.toggle-password:hover {
  color: var(--color-principal);
}

.login-page .forgot-password,
.forgot-password {
  display: inline-flex;
  align-items: center;
  margin: 4px 0 14px;
  padding: 10px 14px;
  border-radius: 999px;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none !important;
  background: linear-gradient(135deg, rgba(28, 46, 89, 0.96), rgba(22, 36, 70, 0.92));
  border: 1px solid rgba(28, 46, 89, 0.22);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

.login-page .forgot-password::before,
.forgot-password::before {
  content: none;
}

.login-page .forgot-password:hover,
.forgot-password:hover {
  color: #ffffff;
  text-decoration: none !important;
  background: linear-gradient(135deg, rgba(28, 46, 89, 0.96), rgba(22, 36, 70, 0.92));
  border-color: rgba(28, 46, 89, 0.22);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.login-page .forgot-password:visited,
.login-page .forgot-password:active,
.login-page .forgot-password:focus-visible,
.forgot-password:visited,
.forgot-password:active,
.forgot-password:focus-visible {
  text-decoration: none !important;
}

.login-page .forgot-password:focus-visible,
.forgot-password:focus-visible {
  outline: none;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(28, 46, 89, 0.96), rgba(22, 36, 70, 0.92));
  border-color: rgba(202, 162, 58, 0.34);
  box-shadow: 0 0 0 4px rgba(223, 190, 88, 0.12), 0 14px 28px rgba(15, 23, 42, 0.12);
}

.auth-switch {
  margin-top: 18px;
  color: var(--color-subtext);
}

.auth-switch .btn--text,
.auth-switch a {
  display: inline-flex;
  margin-left: 4px;
}

.register-page .toast,
.login-page .toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: var(--radius-s);
  color: white;
  font-weight: 700;
  z-index: 9999;
  box-shadow: var(--shadow);
  animation: fadeOut 3s forwards;
}

.login-page .toast {
  animation: none;
  transition: var(--transition);
}

.login-page .toast--success,
.register-page .toast.success {
  background-color: var(--color-success);
}

.login-page .toast--error,
.register-page .toast.error {
  background-color: var(--color-error);
}

.login-page .toast--info {
  background-color: var(--color-info);
}


/*Prova styles animacio registre*/

/* Progrés */
.rc-progress{background:var(--color-surface);border:1px solid var(--color-border);border-radius:12px;padding:12px 14px;margin-bottom:12px;box-shadow:var(--shadow)}
.rc-progress__top{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;font-size:14px;color:var(--color-text)}
.rc-progress__bar{position:relative;height:10px;background:var(--color-surface-2);border-radius:999px;overflow:hidden}
.rc-progress__fill{position:absolute;left:0;top:0;bottom:0;width:0%;background:linear-gradient(90deg,#22c55e,#16a34a);border-radius:999px;transition:width .25s ease}
.rc-progress strong{font-variant-numeric:tabular-nums}

/* (ja tenies) Checklist estil verd quan OK */
.rc-checklist{background:var(--color-surface);border:1px solid var(--color-border);border-radius:12px;padding:16px;box-shadow:var(--shadow);max-width:420px;font-size:14px}
.rc-checklist h3{margin:0 0 10px;font-size:16px}
.rc-checklist ul{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.rc-checklist li{position:relative;padding-left:28px;line-height:1.35;color:var(--color-text)}
.rc-checklist li::before{content:"";position:absolute;left:0;top:2px;width:18px;height:18px;border-radius:50%;border:2px solid var(--color-border);background:var(--color-surface)}
.rc-checklist li[data-ok="true"]{color:#065f46}
.rc-checklist li[data-ok="true"]::before{background:#10b981;border-color:#10b981;box-shadow:inset 0 0 0 2px #fff}
.rc-checklist li[data-ok="true"]::after{content:"✓";position:absolute;left:3px;top:-1px;font-weight:700;color:#fff}

/*ajuda registre*/

.pw-rules {
  list-style:none; margin:6px 0 12px; padding:0;
  font-size:13px; color:var(--color-subtext);
}
.pw-rules li {
  padding-left:20px; position:relative; margin-bottom:4px;
}
.pw-rules li::before {
  content:""; position:absolute; left:0; top:4px;
  width:12px; height:12px; border:2px solid var(--color-border); border-radius:50%;
}
.pw-rules li[data-ok="true"] { color:#065f46; }
.pw-rules li[data-ok="true"]::before { background:#10b981; border-color:#10b981; }

.pw-msg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #8a6a12;
  background: linear-gradient(135deg, rgba(246, 228, 163, 0.28), rgba(232, 199, 92, 0.16));
  border: 1px solid rgba(202, 162, 58, 0.28);
}

.pw-msg::before {
  content: "•";
  font-size: 14px;
  line-height: 1;
  color: #c79a22;
}

.pw-msg.ok {
  color: #065f46;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.22);
}

.pw-msg.ok::before {
  content: "✓";
  color: #059669;
}

.pw-msg.error {
  color: #8a6a12;
  background: linear-gradient(135deg, rgba(246, 228, 163, 0.28), rgba(232, 199, 92, 0.16));
  border-color: rgba(202, 162, 58, 0.28);
}

.pw-msg.error::before {
  content: "•";
  color: #c79a22;
}

#role {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 3.4rem;
  border: 1px solid rgba(28, 46, 89, 0.14);
  background-color: rgba(255, 255, 255, 0.94);
  background-image:
    linear-gradient(135deg, rgba(255,255,255,0.76), rgba(244, 247, 255, 0.92)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%231c2e59' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, calc(100% - 1rem) 50%;
  background-size: auto, 18px 18px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

#role:hover {
  border-color: rgba(194, 154, 44, 0.34);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08), 0 0 0 4px rgba(223, 190, 88, 0.08);
}

#role:focus {
  border-color: rgba(194, 154, 44, 0.52);
  box-shadow: 0 0 0 4px rgba(223, 190, 88, 0.14), 0 18px 34px rgba(15, 23, 42, 0.08);
}

/*Confeti*/
.confetti {
  position: fixed;
  top: -10px;
  width: 10px;
  height: 10px;
  background: red;
  opacity: 0.8;
  animation: fall linear forwards;
  z-index: 9999;
}
@keyframes fall {
  to {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ========================================================= */
/* 🌙 DARK MODE — REGISTRE                                   */
/* ========================================================= */

/* Enllaços login / registre */
[data-theme="dark"] #go-register,
[data-theme="dark"] #go-login,
[data-theme="dark"] .login-page .forgot-password,
[data-theme="dark"] .forgot-password {
  color: #e8edf8;
}

[data-theme="dark"] .login-page .forgot-password,
[data-theme="dark"] .forgot-password {
  color: #e8edf8;
  background: linear-gradient(135deg, rgba(11, 19, 37, 0.98), rgba(16, 27, 50, 0.94));
  border-color: rgba(214, 174, 72, 0.16);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
}

[data-theme="dark"] .login-page .forgot-password::before,
[data-theme="dark"] .forgot-password::before {
  content: none;
}

[data-theme="dark"] .login-page .forgot-password:hover,
[data-theme="dark"] .forgot-password:hover {
  color: #fffaf0;
  background: linear-gradient(135deg, rgba(214, 174, 72, 0.2), rgba(244, 219, 140, 0.12));
  border-color: rgba(214, 174, 72, 0.34);
  box-shadow: 0 22px 38px rgba(0, 0, 0, 0.34), 0 0 0 4px rgba(214, 174, 72, 0.08);
}

[data-theme="dark"] .login-page .forgot-password:focus-visible,
[data-theme="dark"] .forgot-password:focus-visible {
  color: #fffaf0;
  background: linear-gradient(135deg, rgba(214, 174, 72, 0.2), rgba(244, 219, 140, 0.12));
  border-color: rgba(214, 174, 72, 0.42);
  box-shadow: 0 0 0 4px rgba(214, 174, 72, 0.12), 0 22px 38px rgba(0, 0, 0, 0.34);
}

/* ===================== */
/* Contenidors principals */
/* ===================== */

[data-theme="dark"] .rc-progress,
[data-theme="dark"] .rc-checklist {
  background: #111827;
  border: 1px solid #1f2937;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
  color: #e5e7eb;
}

/* Textos interns */
[data-theme="dark"] .rc-progress__top,
[data-theme="dark"] .rc-checklist li,
[data-theme="dark"] .pw-msg {
  color: #cbd5f5;
}

/* ===================== */
/* Barra de progrés      */
/* ===================== */

[data-theme="dark"] .rc-progress__bar {
  background: #1f2937;
}

[data-theme="dark"] .rc-progress__fill {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

/* ===================== */
/* Checklist (cercles)   */
/* ===================== */

[data-theme="dark"] .rc-checklist li::before {
  border-color: #374151;
  background: #020617;
}

/* Checklist OK */
[data-theme="dark"] .rc-checklist li[data-ok="true"] {
  color: #86efac;
}

[data-theme="dark"] .rc-checklist li[data-ok="true"]::before {
  background: #10b981;
  border-color: #10b981;
}

/* ===================== */
/* Regles contrasenya    */
/* ===================== */

[data-theme="dark"] .pw-rules {
  color: #9ca3af;
}

[data-theme="dark"] .pw-rules li::before {
  border-color: #374151;
}

[data-theme="dark"] .pw-rules li[data-ok="true"] {
  color: #86efac;
}

[data-theme="dark"] .pw-rules li[data-ok="true"]::before {
  background: #10b981;
  border-color: #10b981;
}

/* Missatges OK / error */
[data-theme="dark"] .pw-msg.ok {
  color: #86efac;
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.24);
}

[data-theme="dark"] .pw-msg.error {
  color: #f6d782;
  background: linear-gradient(135deg, rgba(196, 150, 25, 0.18), rgba(250, 223, 135, 0.08));
  border-color: rgba(214, 174, 72, 0.3);
}

[data-theme="dark"] .pw-msg::before {
  color: #f0c75e;
}

/* ===================== */
/* Inputs i selects      */
/* ===================== */

[data-theme="dark"] input,
[data-theme="dark"] select {
  background: #0f172a;
  color: #e5e7eb;
  border: 1.5px solid #243047;
}

[data-theme="dark"] #role {
  border-color: rgba(214, 174, 72, 0.16);
  background-color: #0f172a;
  background-image:
    linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(18, 28, 52, 0.98)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23f3d57a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] #role:hover {
  border-color: rgba(214, 174, 72, 0.3);
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.34), 0 0 0 4px rgba(214, 174, 72, 0.08);
}

[data-theme="dark"] input::placeholder {
  color: #9ca3af;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96,165,250,.25);
  background: #020617;
}

[data-theme="dark"] #role:focus {
  border-color: rgba(214, 174, 72, 0.42);
  box-shadow: 0 0 0 4px rgba(214, 174, 72, 0.12), 0 20px 36px rgba(0, 0, 0, 0.34);
  background-color: #0b1325;
}

/* ===================== */
/* Botó registre         */
/* ===================== */

[data-theme="dark"] #registre-btn,
[data-theme="dark"] button[type="submit"] {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: #ffffff;
}

[data-theme="dark"] button[type="submit"]:disabled {
  background: #1f2937;
  color: #9ca3af;
}

/* ===================== */
/* Form Container         */
/* ===================== */

[data-theme="dark"] .form-container {
  background: #020617;
  border: 1px solid #1f2937;
}

/* ===================== */
/* Eye Icon.             */
/* ===================== */

[data-theme="dark"] .eye-icon {
  color: #9ca3af;
}
[data-theme="dark"] .eye-icon:hover {
  color: #e5e7eb;
}

@keyframes fadeOut {
  0%   { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; bottom: 0; }
}
