/* ============================================================
   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 SELECTOR ============= */
.public-lang-selector {
  text-align: right;
  font-size: 13px;
  margin-bottom: 4px;
}

.public-lang-selector a {
  color: var(--link-color, #2084c6);
  text-decoration: none;
  cursor: pointer;
  padding: 0 4px;
  font-weight: 400;
}

.public-lang-selector a:hover {
  text-decoration: underline;
}

.public-lang-selector a.active {
  font-weight: 700;
}

.public-lang-selector .separator {
  color: #ccc;
}

/* ============= RECAPTCHA ============= */
.recaptcha-container {
  margin: 0;
  transform: scale(0.7);
  transform-origin: left center;
  margin-right: -90px;
}

/* 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;
}

/* ============= INFO BOX ============= */
.info-box {
  border-left: none;
  padding: 10px;
  margin-top: 4px;
  margin-bottom: 4px;
  border-radius: 4px;
  text-align: center;
}

.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);
}

/* ============= PAGE ACTIONS (override styles.css private-page flex-end) ============= */
.page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-actions .btn-primary {
  flex-shrink: 0;
  margin-left: auto;
}

/* ============= 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: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: var(--warning-color, #2084c6);
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 10px;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
}

.scheduled-maintenance-banner {
  background: var(--info-color, #1a4480);
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 10px;
  color: #fff;
  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;
  }
}

/* ============= RESPONSIVE — SMALL MOBILE ============= */
@media (max-width: 360px) {
  .otp-input {
    width: 36px;
    height: 42px;
    font-size: 18px;
  }

  .otp-inputs {
    gap: 4px;
  }
}

/* ============= INNER CARD ============= */
.inner-card {
  background: #f8f9fa;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.inner-card .form-section-title {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 14px;
}

/* Read-only fields (pre-filled, not editable) */
.form-group input[readonly] {
  background-color: #e9ecef;
  cursor: not-allowed;
}
