/* ============================================================
   PUBLIC PAGES — Shared styles for login, forgot-password,
   verify-otp, reset-password and future public pages.
   ============================================================ */

/* Body background and scroll for public pages (overrides styles.css default) */
body {
  background: var(--brand-color, #1a4480);
  overflow-y: auto !important;
}

/* ============= LANGUAGE SWITCHER ============= */
.lang-switcher {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 8px;
}

.lang-switcher button {
  background: transparent;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-color, #4b5563);
  cursor: pointer;
  transition: all 0.15s;
  min-width: 32px;
}

.lang-switcher button:hover {
  background: #f1f5f9;
  border-color: var(--brand-color, #1a4480);
}

.lang-switcher button.active {
  background: var(--brand-color, #1a4480);
  color: #fff;
  border-color: var(--brand-color, #1a4480);
}

/* ============= RECAPTCHA ============= */
.recaptcha-container {
  margin: 0;
  transform: scale(0.7);
  transform-origin: left center;
  margin-right: -90px;
}

/* Register actions: captcha left, button right */
.register-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.register-actions .btn-primary {
  flex-shrink: 0;
}

/* Page card title override for secondary pages */
.page-card h1 {
  font-size: 22px;
  margin-bottom: 4px;
}

/* Subtitle reduced spacing */
.page-card .subtitle {
  margin-bottom: 6px;
}

/* Competition name badge */
.competition-info {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-color, #1a4480);
  background: #e3f2fd;
  border-radius: 4px;
  padding: 6px 12px;
  margin-bottom: 12px;
  text-align: center;
}

/* ============= INFO BOX ============= */
.info-box {
  border-left: none;
  padding: 10px;
  margin-top: 4px;
  margin-bottom: 4px;
  border-radius: 4px;
}

.info-box p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

/* Info variant (blue) */
.info-box,
.info-box-info {
  background: #e3f2fd;
}

.info-box p,
.info-box-info p {
  color: #1a3c5f;
}

/* Warning variant (yellow) */
.info-box-warning {
  background: #fff3cd;
}

.info-box-warning p {
  color: #856404;
}

/* ============= BUTTON PRIMARY FLEX ============= */
.page-card .btn-primary {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============= LOADING SPINNER ============= */
.loading {
  display: none;
  margin-left: 8px;
}

.loading.show {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============= PUBLIC MESSAGE BAR ============= */
/* Matches the private-page .message-bar-container / .message-content style */
.public-message-bar {
  display: none;
  background-color: #f8f9fa;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color, #1e293b);
  position: sticky;
  top: 0;
  z-index: 10;
}

.public-message-bar.error {
  color: var(--error-color, #dc3545);
}

.public-message-bar.success {
  color: var(--success-color, #28a745);
}

.public-message-bar.warning {
  color: var(--warning-color, #2084c6);
}

.public-message-bar.info {
  color: var(--info-color);
}

/* ============= BACK LINK ============= */
.back-link {
  text-align: center;
  margin-top: 8px;
}

.back-link a {
  color: var(--link-color);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.back-link a:hover {
  color: var(--btn-primary-bg);
  text-decoration: underline;
}

/* ============= OTP INPUTS ============= */
.otp-inputs {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.otp-input {
  width: 50px;
  height: 55px;
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  border: 2px solid #ced4da;
  border-radius: 6px;
  transition: all 0.3s;
}

.otp-input:focus {
  outline: none;
  border-color: var(--link-color);
  box-shadow: 0 0 0 3px rgba(32, 132, 198, 0.1);
}

.otp-input.filled {
  border-color: #28a745;
  background-color: #f8f9fa;
}

/* ============= RESEND SECTION ============= */
.resend-section {
  text-align: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e9ecef;
}

.resend-section p {
  font-size: 13px;
  margin: 0 0 6px 0;
  opacity: 0.7;
}

.resend-btn {
  background: transparent;
  color: var(--link-color);
  border: 1px solid var(--link-color);
  padding: 8px 16px;
  width: auto;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
}

.resend-btn:hover:not(:disabled) {
  background: var(--link-color);
  color: white;
}

.resend-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============= PASSWORD STRENGTH ============= */
.password-strength {
  margin-top: 4px;
  margin-bottom: 8px;
}

.strength-bar {
  height: 4px;
  background: #e9ecef;
  border-radius: 2px;
  overflow: hidden;
  display: flex;
}

.strength-segment {
  flex: 1;
  margin-right: 2px;
  background: #e9ecef;
  transition: background 0.3s;
}

.strength-segment:last-child {
  margin-right: 0;
}

.strength-text {
  font-size: 11px;
  margin-top: 2px;
  text-align: right;
}

/* ============= MAINTENANCE BANNERS (login page) ============= */
.maintenance-banner {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
  color: #856404;
  font-size: 13px;
  line-height: 1.4;
}

.scheduled-maintenance-banner {
  background: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
  color: #1a3c5f;
  font-size: 13px;
  line-height: 1.4;
}

.banner-time {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.85;
}

/* ============= RESPONSIVE — TABLET ============= */
@media (max-width: 768px) {
  .page-card {
    padding: 20px 16px;
  }
}

/* ============= RESPONSIVE — MOBILE ============= */
@media (max-width: 480px) {
  .page-container {
    padding: 10px 8px;
  }

  .page-card {
    max-width: 100%;
    border-radius: 8px;
  }

  .page-card h1 {
    font-size: 18px;
  }

  .otp-input {
    width: 42px;
    height: 48px;
    font-size: 20px;
  }
}

/* ============= WIDE PAGE CARD (Step 2 Registration) ============= */
.page-card-wide {
  max-width: 600px;
}

/* Scrollable public pages — ensure background covers full scrollable area */
body:has(.page-card-wide) {
  overflow-y: auto;
  min-height: 100vh;
}

body:has(.page-card-wide) .page-container {
  min-height: 100vh;
  height: auto;
  background-attachment: fixed;
}

.welcome-message {
  font-size: 15px;
  color: var(--text-color);
  margin-bottom: 16px;
  font-weight: 500;
}

/* Form row — 2 columns side by side */
.page-card .form-row {
  display: flex;
  gap: 12px;
}

.page-card .form-row .form-group {
  flex: 1;
}

/* Photo upload area */
.photo-upload-area {
  border: 2px dashed var(--border-color, #d1d5db);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s;
  overflow: hidden;
}

.photo-upload-area:hover,
.photo-upload-area.drag-over {
  border-color: var(--brand-color, #1a4480);
}

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  color: var(--text-color);
  opacity: 0.6;
  text-align: center;
}

.photo-placeholder p {
  margin: 8px 0 4px;
  font-size: 14px;
}

.photo-placeholder span {
  font-size: 12px;
}

.photo-preview {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 16px;
}

.photo-preview img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 6px;
  object-fit: cover;
}

.photo-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--error-color, #dc3545);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============= RESPONSIVE — SMALL MOBILE ============= */
@media (max-width: 360px) {
  .otp-input {
    width: 36px;
    height: 42px;
    font-size: 18px;
  }

  .otp-inputs {
    gap: 4px;
  }
}

/* ============= RESPONSIVE — WIDE CARD ============= */
@media (max-width: 640px) {
  .page-card-wide {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .page-card .form-row {
    flex-direction: column;
    gap: 0;
  }
}

/* ================================================================
   THEME: European Aquatics-inspired — bold hero, wave decorations,
   soft card shadow, polished form sections. Overrides the defaults
   set above and in styles.css (cascade wins by source order).
   ================================================================ */

/* --- Body: deep navy gradient + decorative bottom wave -----------*/
body {
  background:
    /* bottom wave (light overlay) */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 200' preserveAspectRatio='none'><path fill='%231a6da8' fill-opacity='0.18' d='M0,128 C240,180 480,80 720,96 C960,112 1200,176 1440,128 L1440,200 L0,200 Z'/><path fill='%23ffffff' fill-opacity='0.08' d='M0,160 C240,200 480,120 720,140 C960,160 1200,200 1440,160 L1440,200 L0,200 Z'/></svg>") bottom center / 100% 200px no-repeat fixed,
    linear-gradient(160deg, #002244 0%, #003a70 40%, #1a4480 100%) fixed;
  min-height: 100vh;
}

/* --- Page container: comfortable vertical padding ----------------*/
.page-container {
  background: transparent !important; /* let body show through */
  padding: 32px 12px;
  align-items: flex-start;
  min-height: 100vh;
}

/* --- Card: soft elevation + top brand bar + rounded corners ------*/
.page-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow:
    0 30px 60px -20px rgba(0, 20, 50, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  padding: 28px 28px 24px;
  position: relative;
  overflow: hidden;
  animation: cardIn 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.page-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, #003a70 0%, #1a6da8 50%, #0099d6 100%);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Hero: logo header + title + subtitle ------------------------*/
.page-logos {
  justify-content: center;
  gap: 18px;
  margin-top: 6px;
  margin-bottom: 14px;
}
.page-logo-provider,
.page-logo-client {
  filter: drop-shadow(0 2px 6px rgba(0, 58, 112, 0.15));
}
.page-card h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--brand-color, #003a70);
  margin: 6px 0 4px;
}
.subtitle {
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  margin: 0 auto 16px;
  line-height: 1.45;
  max-width: 560px;
}

/* --- Language switcher: pill style above the card ---------------*/
.lang-switcher {
  position: absolute;
  top: 14px;
  right: 14px;
  margin-bottom: 0;
  z-index: 2;
}
.lang-switcher button {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(0, 58, 112, 0.15);
  color: #003a70;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 999px;
}
.lang-switcher button:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: #1a6da8;
}
.lang-switcher button.active {
  background: var(--brand-color, #003a70);
  color: #fff;
  border-color: var(--brand-color, #003a70);
  box-shadow: 0 2px 8px rgba(0, 58, 112, 0.35);
}

/* --- Competition info badge --------------------------------------*/
.competition-info {
  display: inline-block;
  background: linear-gradient(135deg, #e8f3fc 0%, #d6e8f6 100%);
  color: #003a70;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border: 1px solid rgba(26, 109, 168, 0.2);
}

/* --- Powered-by footer: lighter, centered ------------------------*/
.page-powered-by {
  margin-top: 18px;
  text-align: center;
  opacity: 0.8;
}

/* --- Responsive tweaks for the hero ------------------------------*/
@media (max-width: 600px) {
  .page-container { padding: 20px 8px; }
  .page-card { padding: 56px 18px 20px; border-radius: 12px; }
  .lang-switcher { top: 10px; right: 10px; }
  .page-card h1 { font-size: 22px; }
}
