:root {
  --ce-primary: #2563eb;
  --ce-primary-dark: #1e40af;
  --ce-border: #d1d5db;
  --ce-surface: #ffffff;
  --ce-text: #1f2937;
  --ce-primary-rgb: 37, 99, 235;
  --ce-primary-dark-rgb: 30, 64, 175;
}

.custom-message {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--ce-border);
  background: rgba(var(--ce-primary-rgb), 0.08);
  color: var(--ce-text);
}

.custom-message.success {
  border-color: #fff;
  background: #fff;
  color: var(--ce-primary-dark);
}

.custom-message.error {
  border-color: var(--ce-primary-dark);
  background: rgba(var(--ce-primary-dark-rgb), 0.08);
  color: var(--ce-primary-dark);
}

.custom-message.info {
  border-color: var(--ce-primary);
  background: rgba(var(--ce-primary-rgb), 0.08);
  color: var(--ce-primary-dark);
}

.ce-auth-gate,
.custom-account,
form.custom-reservation-form,
form.ce-register-form {
  max-width: 980px;
  margin: 1.25rem auto;
}

.custom-account {
  margin: 2rem auto 3rem;
  padding: 0 1rem;
}

.ce-auth-gate {
  max-width: 640px;
  background: var(--ce-surface);
  border: 1px solid var(--ce-border);
  border-radius: 12px;
  padding: 1.2rem;
  display: grid;
  gap: 1rem;
}

.ce-auth-gate .ce-auth-intro {
  margin: 0;
  color: var(--ce-text);
}

.custom-account > section,
form.custom-reservation-form,
form.ce-register-form {
  background: var(--ce-surface);
  border: 1px solid var(--ce-border);
  border-radius: 12px;
  padding: 1.2rem;
}

.custom-account > section {
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 24px rgba(var(--ce-primary-rgb), 0.1);
}

.custom-account h1 {
  margin-bottom: 1.5rem;
}

.custom-account h2 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.custom-account form,
form.custom-reservation-form,
form.ce-register-form {
  display: grid;
  gap: 0.85rem;
}

.custom-account label,
form.custom-reservation-form label,
form.ce-register-form label {
  display: block;
  font-weight: 600;
  color: var(--ce-text);
}

.custom-account form p,
form.custom-reservation-form p,
form.ce-register-form p {
  margin: 0;
}

.custom-account input,
.custom-account textarea,
.custom-account select,
form.custom-reservation-form input,
form.custom-reservation-form textarea,
form.custom-reservation-form select,
form.ce-register-form input,
form.ce-register-form textarea,
form.ce-register-form select {
  width: 100%;
  margin-top: 0.35rem;
  min-height: 44px;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--ce-border);
  border-radius: 8px;
  background: var(--ce-surface);
  color: var(--ce-text);
  box-sizing: border-box;
}

.custom-account textarea,
form.custom-reservation-form textarea,
form.ce-register-form textarea {
  min-height: 110px;
}

.custom-account select,
form.custom-reservation-form select,
form.ce-register-form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2.5rem;
  line-height: 1.3;
  background-color: var(--ce-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%231e40af' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.custom-account select:hover,
form.custom-reservation-form select:hover,
form.ce-register-form select:hover {
  background-color: #fff;
}

.custom-account select:disabled,
form.custom-reservation-form select:disabled,
form.ce-register-form select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.custom-account input:focus,
.custom-account textarea:focus,
.custom-account select:focus,
form.custom-reservation-form input:focus,
form.custom-reservation-form textarea:focus,
form.custom-reservation-form select:focus,
form.ce-register-form input:focus,
form.ce-register-form textarea:focus,
form.ce-register-form select:focus {
  border-color: var(--ce-primary);
  box-shadow: 0 0 0 3px rgba(var(--ce-primary-rgb), 0.16);
  outline: 0;
}

.custom-account input[readonly] {
  background: rgba(var(--ce-primary-rgb), 0.06);
  color: var(--ce-primary-dark);
}

.custom-account input[type="submit"],
.custom-account button,
.custom-account .ce-logout-btn,
form.custom-reservation-form input[type="submit"],
form.ce-register-form button {
  width: auto;
  min-height: 44px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--ce-primary-dark);
  border-radius: 8px;
  background: var(--ce-primary);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.custom-account input[type="submit"]:hover,
.custom-account button:hover,
.custom-account .ce-logout-btn:hover,
.custom-account input[type="submit"]:focus,
.custom-account button:focus,
.custom-account .ce-logout-btn:focus,
form.custom-reservation-form input[type="submit"]:hover,
form.custom-reservation-form input[type="submit"]:focus,
form.ce-register-form button:hover,
form.ce-register-form button:focus {
  background: var(--ce-primary-dark);
  border-color: var(--ce-primary-dark);
}

.custom-account .ce-logout-btn {
  background: transparent;
  color: var(--ce-primary);
  border-color: var(--ce-primary);
}
.custom-account .ce-logout-btn:hover,
.custom-account .ce-logout-btn:focus {
  background: var(--ce-primary);
  color: #fff;
}

.custom-account .ce-hint {
  font-size: 0.9em;
  font-weight: 400;
  color: var(--ce-primary-dark);
}

.ce-auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
}

.ce-tab-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ce-border);
  background: #fff;
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.ce-tab-btn.active {
  border-color: var(--ce-primary);
  background: rgba(var(--ce-primary-rgb), 0.2);
  color: var(--ce-primary);
}

.ce-auth-gate .ce-tab-content form,
.ce-auth-gate .wp-login-form,
.ce-auth-gate form#loginform,
.ce-auth-gate .ce-register-form {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

.ce-auth-gate .wp-login-form p,
.ce-auth-gate form#loginform p,
.ce-auth-gate .ce-register-form p,
.ce-auth-gate .ce-auth-links,
.ce-auth-gate .ce-register-note {
  margin: 0;
}

.ce-auth-gate .wp-login-form label,
.ce-auth-gate form#loginform label {
  display: block;
  font-weight: 600;
  color: var(--ce-text);
}

.ce-auth-gate .wp-login-form input[type="text"],
.ce-auth-gate .wp-login-form input[type="password"],
.ce-auth-gate .wp-login-form input[type="email"],
.ce-auth-gate form#loginform input[type="text"],
.ce-auth-gate form#loginform input[type="password"],
.ce-auth-gate form#loginform input[type="email"] {
  width: 100%;
  margin-top: 0.35rem;
  min-height: 44px;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--ce-border);
  border-radius: 8px;
  background: #fff;
  color: var(--ce-text);
  box-sizing: border-box;
}

.ce-auth-gate .wp-login-form input[type="text"]:focus,
.ce-auth-gate .wp-login-form input[type="password"]:focus,
.ce-auth-gate .wp-login-form input[type="email"]:focus,
.ce-auth-gate form#loginform input[type="text"]:focus,
.ce-auth-gate form#loginform input[type="password"]:focus,
.ce-auth-gate form#loginform input[type="email"]:focus {
  border-color: var(--ce-primary);
  box-shadow: 0 0 0 3px rgba(var(--ce-primary-rgb), 0.16);
  outline: 0;
}

.ce-auth-gate .wp-login-form .login-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.ce-auth-gate form#loginform .login-username,
.ce-auth-gate form#loginform .login-password,
.ce-auth-gate form#loginform .login-submit {
  width: 100%;
}

.ce-auth-gate form#loginform .login-remember {
  display: flex;
  align-items: center;
  min-height: 20px;
}

.ce-auth-gate .wp-login-form .login-remember label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.ce-auth-gate form#loginform .login-remember label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.ce-auth-gate .wp-login-form .login-remember input[type="checkbox"] {
  margin: 0;
}

.ce-auth-gate form#loginform .login-remember input[type="checkbox"] {
  margin: 0;
}

.ce-auth-gate .wp-login-form .login-submit,
.ce-auth-gate form#loginform .login-submit,
.ce-auth-gate .ce-register-form > p:last-child {
  margin-top: 0.2rem;
}

.ce-auth-gate .wp-login-form .button,
.ce-auth-gate form#loginform .button,
.ce-auth-gate .ce-register-form .button {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--ce-primary-dark);
  border-radius: 8px;
  background: var(--ce-primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.ce-auth-gate .wp-login-form .button:hover,
.ce-auth-gate form#loginform .button:hover,
.ce-auth-gate .ce-register-form .button:hover {
  background: var(--ce-primary-dark);
}

.ce-auth-gate .ce-auth-links,
.ce-auth-gate .ce-register-note {
  font-size: 0.95rem;
  color: var(--ce-primary-dark);
}
.ce-auth-gate .ce-auth-links {
  text-align: center;
  padding-top: 0.6rem;
}

.ce-auth-gate .ce-auth-links a {
  color: var(--ce-primary);
  text-decoration: none;
}

.ce-auth-gate .ce-auth-links a:hover {
  text-decoration: underline;
}

.ce-username-assist {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.ce-reservations-list {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ce-reservation-item + .ce-reservation-item {
  margin-top: 0;
}

.custom-account .ce-reservation-item {
  padding: 0;
  border: 0;
  background: transparent;
}

.ce-reservation-card {
  border: 1px solid var(--ce-border);
  border-radius: 10px;
  background: rgba(var(--ce-primary-rgb), 0.06);
  overflow: hidden;
}

.ce-reservation-card summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  font-weight: 600;
  list-style: none;
}

.ce-reservation-card summary::-webkit-details-marker {
  display: none;
}

.ce-reservation-content {
  padding: 1rem 1.1rem 1.1rem;
}

.ce-reservation-details {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem;
}

.ce-reservation-details dt {
  font-weight: 600;
}

.ce-reservation-details dd {
  margin: 0.1rem 0 0;
}

.ce-reservation-details__full {
  grid-column: 1 / -1;
}

.ce-reservation-summary-meta {
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--ce-primary-dark);
  white-space: nowrap;
}

.ce-reservation-card[open] summary {
  background: #f8fafc;
}
.ce-reservation-card[open] .ce-cancel-trigger:hover {
  color: #c9302c;
  background-color: #ffbbb9;
}

.ce-cancel-confirm {
  margin-top: 1rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

.ce-cancel-trigger {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  border: 2px solid #d9534f;
  color: #b52b27;
  border-radius: 8px;
  padding: 0.45em 1em;
  font-weight: 600;
  background: transparent;
  user-select: none;
}

.ce-cancel-trigger::before {
  content: "\2715";
  line-height: 1;
  font-size: 0.85em;
}

.ce-cancel-trigger:hover,
.ce-cancel-trigger:focus-visible {
  background: #c9302c;
  color: #fff;
  border-color: #c9302c;
  outline: none;
}

.ce-cancel-confirm summary.ce-cancel-trigger::-webkit-details-marker,
.ce-cancel-confirm summary.ce-cancel-trigger::marker {
  display: none;
}

.ce-cancel-confirm-panel {
  margin-top: 1rem;
  border: 1px solid #f1c2c2;
  background: #fff5f5;
  border-radius: 8px;
  padding: 1rem 1.1rem;
}

.ce-cancel-confirm-warning {
  margin-bottom: 1rem;
  color: #7a1f1c;
  font-size: 0.95rem;
}

.ce-cancel-btn {
  border: 2px solid #d9534f !important;
  color: #b52b27 !important;
  background: transparent !important;
  border-radius: 8px;
  padding: 0.45em 1.1em;
  font-weight: 600;
}

.ce-cancel-btn:hover {
  color: #fff !important;
  background: #c9302c !important;
  border-color: #c9302c !important;
}

.custom-account #deconnexion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.custom-account #deconnexion h2,
.custom-account #deconnexion p {
  margin: 0;
}

@media (min-width: 782px) {
  .custom-account {
    max-width: 1080px;
  }

  .custom-account #mes-informations form,
  .custom-account #mot-de-passe form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.5rem;
    align-items: start;
  }

  .custom-account #mes-informations form p:last-child,
  .custom-account #mot-de-passe form p:first-of-type,
  .custom-account #mot-de-passe form p:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  .ce-auth-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .custom-account form {
    grid-template-columns: 1fr;
  }

  .custom-account #deconnexion {
    display: block;
  }

  .custom-account #deconnexion p {
    margin-top: 1rem;
  }

  .custom-account input[type="submit"],
  .custom-account button,
  .custom-account .ce-logout-btn {
    width: 100%;
  }

  .ce-reservation-card summary,
  .ce-reservation-details {
    display: block;
  }

  .ce-reservation-summary-meta {
    display: block;
    margin-top: 0.35rem;
  }

  .ce-reservation-details div + div {
    margin-top: 0.8rem;
  }
}
