/**
 * Patient Tool Auth - Shared Component Styles
 * PCOS Ferticure Clinic
 */

/* --- Logged-In Top Session Banner --- */
.patient-auth-banner {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #16a34a;
  border-radius: 8px;
  padding: 12px 18px;
  margin: 16px 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.patient-auth-banner-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #166534;
  font-size: 0.95rem;
}

.patient-badge-icon {
  font-size: 1.25rem;
}

.patient-auth-banner-inner strong {
  color: #14532d;
  font-weight: 600;
}

.patient-badge-mobile {
  color: #15803d;
  font-size: 0.88rem;
  letter-spacing: 0.5px;
}

.patient-badge-action {
  background: transparent;
  border: 1px solid #86efac;
  color: #15803d;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.patient-badge-action:hover {
  background: #dcfce7;
  border-color: #4ade80;
  color: #14532d;
}

/* --- Modal Overlay & Dialog --- */
.patient-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.patient-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.patient-modal-card {
  background: #ffffff;
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.patient-modal-overlay.is-active .patient-modal-card {
  transform: translateY(0) scale(1);
}

/* Prevent page background scrolling when modal is active */
body.patient-modal-open {
  overflow: hidden !important;
  touch-action: none;
}

/* Modal Header */
.patient-modal-header {
  padding: 24px 56px 16px 24px;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: #ffffff;
  position: relative;
}

.patient-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.patient-modal-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: #ffffff;
}

.patient-modal-header p {
  font-size: 0.88rem;
  margin: 0;
  color: #ccfbf1;
  line-height: 1.4;
}

.patient-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, border-color 0.2s;
  z-index: 10;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.patient-modal-close:hover,
.patient-modal-close:focus-visible {
  background: rgba(255, 255, 255, 0.35);
  border-color: #ffffff;
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  transform: scale(1.05);
}

.patient-modal-close:active {
  transform: scale(0.95);
}

/* Modal Body */
.patient-modal-body {
  padding: 24px;
}

.patient-gate-screen {
  display: none;
}

.patient-gate-screen.is-active {
  display: block;
  animation: fadeInGate 0.2s ease-in-out;
}

@keyframes fadeInGate {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Form Controls */
.patient-form-group {
  margin-bottom: 18px;
}

.patient-form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.patient-form-group .patient-help-text {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 4px;
  display: block;
}

.patient-input-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
}

.patient-select,
.patient-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.95rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #1e293b;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.patient-select:focus,
.patient-input:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

/* Locked Field */
.patient-locked-box {
  background: #f8fafc;
  border: 1.5px dashed #94a3b8;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.patient-locked-box .locked-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.patient-locked-box .locked-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f766e;
}

.patient-locked-box .locked-icon {
  font-size: 1rem;
  color: #64748b;
}

/* Password Toggle Wrapper */
.patient-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.patient-password-wrap input {
  padding-right: 42px;
}

.patient-pwd-toggle {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
}

.patient-pwd-toggle:hover {
  color: #0d9488;
}

/* Checkbox Label */
.patient-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.4;
  cursor: pointer;
}

.patient-checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: #0d9488;
}

/* Feedback Alert */
.patient-alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 16px;
  display: none;
}

.patient-alert.is-error {
  display: block;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.patient-alert.is-success {
  display: block;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

/* Buttons */
.patient-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.btn-patient-primary {
  width: 100%;
  background: #0d9488;
  color: #ffffff;
  border: none;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-patient-primary:hover {
  background: #0f766e;
}

.btn-patient-primary:active {
  transform: translateY(1px);
}

.btn-patient-secondary {
  width: 100%;
  background: transparent;
  color: #475569;
  border: 1px solid #cbd5e1;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-patient-secondary:hover {
  background: #f1f5f9;
  color: #1e293b;
}

/* Forgot Password link */
.patient-forgot-pass {
  text-align: right;
  margin: -8px 0 16px;
}

.patient-forgot-pass a {
  font-size: 0.82rem;
  color: #0d9488;
  text-decoration: underline;
  cursor: pointer;
}

.patient-forgot-pass a:hover {
  color: #0f766e;
}

/* WhatsApp Help Card */
.patient-whatsapp-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
}

.patient-whatsapp-card p {
  font-size: 0.88rem;
  color: #166534;
  margin: 0 0 12px;
}

.btn-patient-whatsapp {
  background: #25d366;
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-patient-whatsapp:hover {
  background: #20ba5a;
}

/* Responsive adjust */
@media (max-width: 480px) {
  .patient-input-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .patient-modal-header {
    padding: 20px 50px 14px 18px;
  }
  .patient-modal-close {
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    font-size: 1.3rem;
  }
  .patient-modal-body {
    padding: 18px;
  }
}
