/* ============================================
   MMLA PORTAL - VIBRANT GRADIENT UI
   ============================================ */

/* CSS Variables */
:root {
  --primary: #0A3D62;
  --primary-light: #1a5a8a;
  --primary-dark: #072b47;
  --accent: #2980b9;
  --success: #27ae60;
  --error: #e74c3c;
  --warning: #f39c12;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --white: #ffffff;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
  --gradient-primary: linear-gradient(135deg, #0A3D62 0%, #2980b9 100%);
  --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --gradient-purple: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-orange: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Portal App Container */
.portal-app {
  min-height: calc(100vh - 70px);
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
}

/* Page Layouts */
.portal-page {
  padding: 40px 20px;
}

.portal-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Typography */
.page-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 8px 0;
}

.page-subtitle {
  font-size: 16px;
  color: var(--gray-500);
  margin: 0 0 30px 0;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.card h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gray-100);
}

.card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 20px 0 12px 0;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10, 61, 98, 0.1);
}

.form-group input:disabled {
  background: var(--gray-100);
  color: var(--gray-500);
  cursor: not-allowed;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
  .form-row, .form-row-3 {
    grid-template-columns: 1fr;
  }
}

/* Checkbox */
.checkbox-group {
  margin: 16px 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-600);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--white);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(10, 61, 98, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
}

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

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

/* Login & Register Pages */
.portal-login-page,
.portal-register-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 70px);
  padding: 40px 20px;
}

.login-card,
.register-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.register-card {
  max-width: 560px;
}

.login-header,
.register-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h1,
.register-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 8px 0;
}

.login-header p,
.register-header p {
  color: var(--gray-500);
  margin: 0;
}

.login-footer,
.register-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
}

.login-footer p,
.register-footer p {
  color: var(--gray-500);
  font-size: 14px;
  margin: 0;
}

.login-footer a,
.register-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

/* Dashboard */
.dashboard-header {
  margin-bottom: 32px;
}

.dashboard-header h1 {
  font-size: 32px;
  margin: 0 0 8px 0;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dashboard-header .subtitle {
  color: var(--gray-500);
  font-size: 16px;
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
}

.stat-icon {
  font-size: 40px;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

.stat-referrals .stat-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-resources .stat-icon {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-member .stat-icon {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-content h3 {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.stat-content p {
  font-size: 14px;
  color: var(--gray-500);
  margin: 4px 0 0 0;
}

/* Quick Actions */
.quick-actions h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0 0 20px 0;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.action-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--gray-700);
  font-weight: 500;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.action-card:hover {
  background: var(--gradient-primary);
  color: var(--white);
  transform: translateY(-4px);
}

.action-icon {
  font-size: 28px;
}

.last-login {
  text-align: center;
  color: var(--gray-400);
  font-size: 13px;
  margin-top: 40px;
}

/* Resources Grid */
.filter-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 10px 20px;
  border: 2px solid var(--gray-200);
  border-radius: 25px;
  background: var(--white);
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-tab.active {
  border-color: transparent;
  color: var(--white);
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.resource-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.resource-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.resource-header {
  padding: 24px;
  position: relative;
}

.resource-header h3 {
  color: var(--white);
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
}

.resource-type {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.25);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.resource-body {
  padding: 20px 24px;
}

.resource-body p {
  color: var(--gray-600);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 16px 0;
}

.resource-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.resource-category {
  background: var(--gray-100);
  color: var(--gray-600);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

/* Referrals list (dashboard) */
.referrals-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 14px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.referrals-table thead {
  background: #1a3a5c;
  color: #fff;
}

.referrals-table th,
.referrals-table td {
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid #e8ecf0;
}

.referrals-table th {
  font-weight: 600;
  font-size: 13px;
  text-transform: none;
  letter-spacing: normal;
}

.referrals-table tbody tr:hover {
  background: #f5f8fa;
}

.referrals-table tbody tr:last-child td {
  border-bottom: none;
}

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.pending {
  background: #fff3cd;
  color: #856404;
}

.status-badge.validated {
  background: #d1e7dd;
  color: #0a3622;
}

.status-badge.error {
  background: #f8d7da;
  color: #842029;
}

.field-hint {
  font-size: 12px;
  color: #6b7280;
  margin: 4px 0 0;
}

/* Page Header Row */
.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

/* Referral Form */
.referral-form-card {
  border-left: 4px solid var(--primary);
}

/* Native <select>: extra vertical space so long labels (e.g. "Cardiology referral") are not clipped */
.referral-form-card select,
#reason {
  min-height: 3.25rem;
  padding: 0.875rem 2.75rem 0.875rem 1rem;
  line-height: 1.45;
  font-size: 16px;
  box-sizing: border-box;
}

.referral-form-card select option,
#reason option {
  padding: 0.65rem 1rem;
  line-height: 1.5;
  white-space: normal;
}

.form-section {
  margin-bottom: 24px;
}

.form-section h3 {
  margin-top: 0;
}

/* Contact Page */
.contact-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-card h3 {
  margin-top: 0;
  font-size: 16px;
  color: var(--gray-800);
}

.info-item {
  margin-bottom: 16px;
}

.info-item strong {
  display: block;
  font-size: 12px;
  color: var(--gray-500);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.info-item p {
  margin: 0;
  color: var(--gray-700);
}

.success-state {
  text-align: center;
  padding: 40px 20px;
}

.success-state p {
  font-size: 18px;
  color: var(--gray-700);
  margin-bottom: 20px;
}

/* Loading */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-container p {
  color: var(--gray-500);
}

/* Empty States */
.empty-state,
.empty-text {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-500);
}

.empty-state {
  background: var(--gray-50);
  border-radius: var(--radius);

/* Resend Verification Section */
.resend-verification {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
}

.resend-verification p {
  text-align: center;
  color: var(--gray-600);
  font-size: 14px;
  margin-bottom: 12px;
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
  background: var(--gray-200);
}

}

/*# sourceMappingURL=portal.css.map*/