/* ===========================================
   PATIENT PORTAL — Voice-Controlled, AI-Assisted
   =========================================== */

.patient-portal-page {
  background-color: #FBFAF5;
  min-height: 100vh;
}

/* ===========================================
   LOGIN SCREEN
   =========================================== */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90vh;
  padding: 2rem 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: white;
  border-radius: 1.5rem;
  padding: 2.5rem 2rem;
  box-shadow: 0 8px 40px rgba(58, 50, 44, 0.1);
  text-align: center;
}

.login-brand h1 {
  font-family: var(--font-serif, 'Lora', Georgia, serif);
  font-size: 1.5rem;
  color: var(--color-chocolate, #3A322C);
  margin-bottom: 0.25rem;
}

.login-brand p {
  font-size: 0.9rem;
  color: var(--color-olive, #7A8B5E);
  font-weight: 500;
  margin-bottom: 2rem;
}

.login-form {
  text-align: left;
}

.form-field {
  margin-bottom: 1.25rem;
}

.form-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-slate, #4A433D);
  margin-bottom: 0.35rem;
}

.form-field input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid rgba(58, 50, 44, 0.12);
  border-radius: 0.75rem;
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  font-size: 0.95rem;
  color: var(--color-chocolate, #3A322C);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-field input:focus {
  outline: none;
  border-color: var(--color-olive, #7A8B5E);
  box-shadow: 0 0 0 3px rgba(122, 139, 94, 0.1);
}

.password-wrapper {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #b8b0a6;
  cursor: pointer;
  padding: 0.25rem;
}

.toggle-password:hover {
  color: var(--color-chocolate, #3A322C);
}

.login-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.85rem;
  font-size: 1rem;
}

.login-footer {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.82rem;
}

.login-footer a {
  color: var(--color-olive, #7A8B5E);
  text-decoration: none;
}

.login-footer a:hover {
  text-decoration: underline;
}

.login-note {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: #b8b0a6;
  font-style: italic;
}

/* ===========================================
   DASHBOARD SCREEN
   =========================================== */
.dashboard-screen {
  padding-bottom: 4rem;
}

/* Welcome Bar */
.welcome-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.welcome-greeting {
  font-size: 0.9rem;
  color: var(--color-slate, #4A433D);
  margin-bottom: 0.15rem;
}

.welcome-name {
  font-family: var(--font-serif, 'Lora', Georgia, serif);
  font-size: 1.4rem;
  color: var(--color-chocolate, #3A322C);
  font-weight: 500;
  margin: 0;
}

.welcome-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.voice-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(122, 139, 94, 0.08);
  border: 1px solid rgba(122, 139, 94, 0.2);
  border-radius: 2rem;
  padding: 0.5rem 1rem;
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  font-size: 0.82rem;
  color: var(--color-olive, #7A8B5E);
  cursor: pointer;
  transition: all 0.25s;
}

.voice-toggle-btn:hover {
  background: var(--color-olive, #7A8B5E);
  color: white;
}

.voice-toggle-btn.active {
  background: var(--color-olive, #7A8B5E);
  color: white;
  animation: voiceGlow 2s ease-in-out infinite;
}

@keyframes voiceGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(122, 139, 94, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(122, 139, 94, 0); }
}

/* Voice Bar */
.voice-bar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 1rem;
}

.voice-bar-inner {
  background: rgba(122, 139, 94, 0.06);
  border: 1px solid rgba(122, 139, 94, 0.15);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.voice-wave-bars {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 24px;
}

.voice-wave-bars span {
  width: 3px;
  background: var(--color-olive, #7A8B5E);
  border-radius: 2px;
  animation: waveBar 0.8s ease-in-out infinite;
}

.voice-wave-bars span:nth-child(1) { height: 12px; }
.voice-wave-bars span:nth-child(2) { height: 20px; animation-delay: 0.1s; }
.voice-wave-bars span:nth-child(3) { height: 28px; animation-delay: 0.2s; }
.voice-wave-bars span:nth-child(4) { height: 20px; animation-delay: 0.3s; }
.voice-wave-bars span:nth-child(5) { height: 12px; animation-delay: 0.4s; }

@keyframes waveBar {
  0%, 100% { transform: scaleY(1); opacity: 0.5; }
  50% { transform: scaleY(1.8); opacity: 1; }
}

.voice-bar-inner p {
  font-size: 0.85rem;
  color: var(--color-olive, #7A8B5E);
  font-style: italic;
}

/* Client Selector */
.client-selector-bar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 1.5rem;
}

.selector-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.selector-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-slate, #4A433D);
  white-space: nowrap;
}

.client-select {
  flex: 1;
  min-width: 250px;
  -webkit-appearance: none;
  appearance: none;
  background: white;
  border: 1.5px solid rgba(58, 50, 44, 0.1);
  border-radius: 0.85rem;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  font-size: 0.88rem;
  font-weight: 450;
  color: var(--color-chocolate, #3A322C);
  cursor: pointer;
  transition: all 0.25s;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='9' viewBox='0 0 14 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L7 7.5L13 1.5' stroke='%237A8B5E' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 14px 9px;
}

.client-select:hover {
  border-color: var(--color-olive, #7A8B5E);
  background-color: #fcfbf8;
  box-shadow: 0 2px 8px rgba(122, 139, 94, 0.06);
}

.client-select:focus {
  outline: none;
  border-color: var(--color-olive, #7A8B5E);
  box-shadow: 0 0 0 4px rgba(122, 139, 94, 0.08);
  background-color: white;
}

.client-select:not([value=""]):not(:focus) {
  border-color: rgba(122, 139, 94, 0.2);
  background-color: #fcfbf7;
}

/* ===========================================
   PORTAL GRID
   =========================================== */
.portal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.portal-card {
  background: white;
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 2px 14px rgba(58, 50, 44, 0.04);
  border: 1px solid rgba(58, 50, 44, 0.05);
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-header h2 {
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-chocolate, #3A322C);
  margin: 0;
}

.card-badge {
  font-size: 0.72rem;
  color: var(--color-olive, #7A8B5E);
  background: rgba(122, 139, 94, 0.08);
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  font-weight: 500;
}

/* Profile Grid */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.profile-item {
  padding: 0.6rem 0.75rem;
  background: rgba(122, 139, 94, 0.03);
  border-radius: 0.6rem;
}

.profile-item .item-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b8b0a6;
  margin-bottom: 0.15rem;
}

.profile-item .item-value {
  font-size: 0.88rem;
  color: var(--color-chocolate, #3A322C);
  font-weight: 500;
}

.profile-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Timeline */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-event {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 0;
  position: relative;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-olive, #7A8B5E);
  margin-top: 0.3rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.timeline-event:not(:last-child) .timeline-dot::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 4px;
  width: 1px;
  height: calc(100% + 4px);
  background: rgba(58, 50, 44, 0.08);
}

.timeline-event-content {
  flex: 1;
}

.timeline-event-content .event-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-chocolate, #3A322C);
}

.timeline-event-content .event-date {
  font-size: 0.72rem;
  color: #b8b0a6;
}

/* ===========================================
   SCHEDULE BUILDER — Elevated Design
   =========================================== */
.schedule-card {
  background: white;
  border: 1px solid rgba(58, 50, 44, 0.06);
  box-shadow: 0 4px 24px rgba(58, 50, 44, 0.06);
  border-radius: 1.5rem;
  overflow: hidden;
}

/* Schedule header with subtle gradient */
.schedule-card .card-header {
  background: linear-gradient(135deg, #f8f5ef 0%, #f3efe6 100%);
  padding: 1.25rem 1.5rem;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(58, 50, 44, 0.05);
}

.schedule-card .card-header h2 {
  font-family: var(--font-serif, 'Lora', Georgia, serif);
  font-size: 1.15rem;
  color: var(--color-chocolate, #3A322C);
}

.schedule-card .card-badge {
  background: rgba(122, 139, 94, 0.1);
  color: var(--color-olive, #7A8B5E);
  font-size: 0.7rem;
  padding: 0.25rem 0.7rem;
  border-radius: 1.5rem;
  letter-spacing: 0.03em;
}

/* Schedule prompt — warm and inviting */
.schedule-prompt {
  font-family: var(--font-serif, 'Lora', Georgia, serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--color-slate, #4A433D);
  margin: 1.25rem 1.5rem 0.75rem;
  padding: 0;
}

.schedule-prompt span {
  color: var(--color-olive, #7A8B5E);
  font-weight: 500;
}

/* Schedule form — clean card within card */
.schedule-form {
  margin: 0 1.5rem 1rem;
  padding: 1.25rem;
  background: #fbfaf7;
  border-radius: 1rem;
  border: 1px solid rgba(58, 50, 44, 0.05);
  gap: 0.85rem;
}

/* Dropdowns — refined styling */
.schedule-form .dropdown-filter {
  -webkit-appearance: none;
  appearance: none;
  background: white;
  border: 1.5px solid rgba(58, 50, 44, 0.1);
  border-radius: 0.85rem;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  font-size: 0.88rem;
  font-weight: 450;
  color: var(--color-chocolate, #3A322C);
  cursor: pointer;
  transition: all 0.25s;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='9' viewBox='0 0 14 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L7 7.5L13 1.5' stroke='%237A8B5E' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 14px 9px;
  position: relative;
  margin-bottom: 20px;
}

.schedule-form .dropdown-filter:hover {
  border-color: var(--color-olive, #7A8B5E);
  background-color: #fcfbf8;
  box-shadow: 0 2px 8px rgba(122, 139, 94, 0.06);
}

.schedule-form .dropdown-filter:focus {
  outline: none;
  border-color: var(--color-olive, #7A8B5E);
  box-shadow: 0 0 0 4px rgba(122, 139, 94, 0.08);
  background-color: white;
}

/* Selected state — when a value is chosen */
.schedule-form .dropdown-filter:not([value=""]):not(:focus) {
  border-color: rgba(122, 139, 94, 0.2);
  background-color: #fcfbf7;
}

/* Optgroup labels */
.schedule-form .dropdown-filter optgroup {
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--color-olive, #7A8B5E);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0;
}

/* Individual options */
.schedule-form .dropdown-filter option {
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  font-weight: 400;
  font-size: 0.88rem;
  color: var(--color-chocolate, #3A322C);
  padding: 0.5rem 0.75rem;
  background: white;
}

.schedule-form .dropdown-filter option:hover,
.schedule-form .dropdown-filter option:checked {
  background: rgba(122, 139, 94, 0.08);
  color: var(--color-olive, #7A8B5E);
}

/* Disabled state */
.schedule-form .dropdown-filter:disabled {
  background-color: #f5f2ec;
  border-color: rgba(58, 50, 44, 0.06);
  color: #c5bfb4;
  cursor: not-allowed;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='9' viewBox='0 0 14 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L7 7.5L13 1.5' stroke='%23c5bfb4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Three-column row — balanced spacing */
.schedule-form .form-row.three-col {
  gap: 0.65rem;
}

.schedule-form .form-row.three-col > * {
  flex: 1;
  min-width: 90px;
}

/* Textarea — soft and integrated */
.schedule-form .log-textarea {
  width: 100%;
  box-sizing: border-box;
  background: white;
  border: 1.5px solid rgba(58, 50, 44, 0.1);
  border-radius: 0.85rem;
  padding: 0.75rem 1rem;
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  font-size: 0.88rem;
  color: var(--color-chocolate, #3A322C);
  resize: vertical;
  min-height: 52px;
  transition: border-color 0.25s, box-shadow 0.25s;
  margin: 0;
}

.schedule-form .log-textarea:focus {
  border-color: var(--color-olive, #7A8B5E);
  box-shadow: 0 0 0 3px rgba(122, 139, 94, 0.08);
}

.schedule-form .log-textarea::placeholder {
  color: #c5bfb4;
  font-style: italic;
}

/* Checkboxes — refined */
.schedule-form .checkbox-label {
  font-size: 0.84rem;
  color: var(--color-slate, #4A433D);
  gap: 0.5rem;
  padding: 0.35rem 0;
}

.schedule-form .checkbox-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--color-olive, #7A8B5E);
  border-radius: 4px;
  margin-bottom: 20px;
}

/* Add to Schedule button */
.schedule-form .btn-primary {
  align-self: flex-start;
  padding: 0.75rem 2rem;
  font-size: 0.9rem;
  border-radius: 0.75rem;
  background: var(--color-olive, #7A8B5E);
  transition: all 0.25s;
  margin-top: 0.25rem;
}

.schedule-form .btn-primary:hover:not(:disabled) {
  background: #6b7c51;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(122, 139, 94, 0.25);
}

.schedule-form .btn-primary:disabled {
  background: #d4cfc7;
  opacity: 1;
  cursor: not-allowed;
}

/* Conflict warning — gentle amber */
.conflict-warning {
  margin: 0 1.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  background: rgba(194, 122, 90, 0.06);
  border: 1px solid rgba(194, 122, 90, 0.15);
  border-radius: 0.75rem;
  color: var(--color-terracotta, #C27A5A);
  font-size: 0.83rem;
  font-weight: 500;
  animation: conflictShake 0.4s ease;
}

@keyframes conflictShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* Upcoming Schedule — elegant list */
.upcoming-schedule {
  padding: 0 1.5rem 1.25rem;
}

.upcoming-schedule h3 {
  font-family: var(--font-serif, 'Lora', Georgia, serif);
  font-size: 1rem;
  color: var(--color-chocolate, #3A322C);
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(58, 50, 44, 0.06);
}

.schedule-list {
  gap: 0.35rem;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* Custom scrollbar for schedule list */
.schedule-list::-webkit-scrollbar {
  width: 4px;
}

.schedule-list::-webkit-scrollbar-track {
  background: transparent;
}

.schedule-list::-webkit-scrollbar-thumb {
  background: rgba(122, 139, 94, 0.25);
  border-radius: 2px;
}

/* Schedule item — elevated card feel */
.schedule-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  background: #fbfaf7;
  border: 1px solid rgba(58, 50, 44, 0.04);
  font-size: 0.85rem;
  color: var(--color-chocolate, #3A322C);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.schedule-item:hover {
  background: white;
  border-color: rgba(122, 139, 94, 0.15);
  box-shadow: 0 2px 10px rgba(58, 50, 44, 0.05);
  transform: translateY(-1px);
}

/* Time badge */
.schedule-item-time {
  font-weight: 600;
  font-size: 0.78rem;
  color: white;
  background: var(--color-olive, #7A8B5E);
  padding: 0.3rem 0.6rem;
  border-radius: 0.5rem;
  min-width: 56px;
  text-align: center;
  letter-spacing: 0.02em;
}

.schedule-item-type {
  flex: 1;
  font-weight: 500;
  font-size: 0.85rem;
  line-height: 1.3;
}

.schedule-item-type small {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--color-slate, #4A433D);
  margin-top: 0.1rem;
}

/* Delete button — subtle until hover */
.schedule-item-delete {
  background: none;
  border: none;
  color: #c5bfb4;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.25rem 0.4rem;
  border-radius: 0.4rem;
  opacity: 0;
  transition: all 0.2s;
  line-height: 1;
}

.schedule-item:hover .schedule-item-delete {
  opacity: 1;
}

.schedule-item-delete:hover {
  background: rgba(194, 122, 90, 0.1);
  color: var(--color-terracotta, #C27A5A);
}

/* Empty state — centered and calm */
.empty-state {
  font-size: 0.88rem;
  color: #c5bfb4;
  font-style: italic;
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: #fbfaf7;
  border-radius: 0.75rem;
  border: 1px dashed rgba(58, 50, 44, 0.08);
}

/* ===========================================
   NFC MODAL
   =========================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(58, 50, 44, 0.4);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-card {
  background: white;
  border-radius: 1.25rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 12px 48px rgba(58, 50, 44, 0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 0;
}

.modal-header h2 {
  font-size: 1.1rem;
  color: var(--color-chocolate, #3A322C);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #b8b0a6;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--color-chocolate, #3A322C);
}

.modal-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.nfc-status {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(122, 139, 94, 0.04);
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

.nfc-indicator {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.nfc-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(122, 139, 94, 0.3);
  animation: nfcPulse 2s ease-out infinite;
}

@keyframes nfcPulse {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.5); opacity: 0; }
}

.nfc-dot {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: var(--color-olive, #7A8B5E);
}

.nfc-tag-id {
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--color-chocolate, #3A322C);
  margin-bottom: 0.15rem;
}

.nfc-assigned {
  font-size: 0.75rem;
  color: #b8b0a6;
}

.nfc-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.nfc-log h4 {
  font-size: 0.85rem;
  color: var(--color-chocolate, #3A322C);
  margin-bottom: 0.5rem;
}

.nfc-log-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.nfc-log-item {
  font-size: 0.78rem;
  color: var(--color-slate, #4A433D);
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(58, 50, 44, 0.04);
}

.nfc-log-item:last-child {
  border-bottom: none;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 800px) {
  .portal-grid {
    grid-template-columns: 1fr;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .form-row.three-col {
    flex-direction: column;
  }
}

@media (max-width: 500px) {
  .login-card {
    padding: 2rem 1.25rem;
  }

  .welcome-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .selector-inner {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===========================================
   NFC MODAL VISIBILITY AUTHORITY
   Closed by default. Opened only by JavaScript.
   =========================================== */

  #nfc-modal[hidden] {
    display: none;
  }

  #nfc-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
  }

  #nfc-modal.is-open {
    display: flex;
  }