/* ============================================
   Coach4U Shared Design System — css/style.css
   Version: 2.2
   ============================================ */

:root {
  --primary:        #003366;
  --primary-dark:   #002244;
  --accent:         #0D9488;
  --accent-dark:    #0F766E;
  --text:           #333333;
  --text-muted:     #888888;
  --divider:        #eeeeee;
  --capacity:       #0D9488;
  --wellbeing:      #5DADE2;
  --strengths:      #B19CD9;
  --execution:      #7851A9;
  --bg:             #ffffff;
  --surface:        #ffffff;
  --border:         #e2e8f0;
  --font-body:      'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading:   'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius:         10px;
  --radius-sm:      6px;
  --shadow:         0 2px 8px rgba(13,148,136,0.12);
  --shadow-lg:      0 6px 16px rgba(13,148,136,0.22);
  --shadow-neutral: 0 2px 8px rgba(0,0,0,0.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6,
.login-title, .page-title, .header-title,
.login-logo h1 {
  font-family: var(--font-heading);
  font-weight: 700;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; }

/* ----- Login Page ----- */
.login-page {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
}
.login-card {
  background: white; border-radius: 12px; padding: 32px 24px;
  max-width: 380px; width: 100%; box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.login-logo { text-align: center; margin-bottom: 20px; }
.login-logo h1 { font-size: 24px; font-weight: 700; color: var(--primary); letter-spacing: -0.5px; }
.login-title { font-size: 20px; font-weight: 700; color: var(--primary); margin-bottom: 6px; text-align: center; }
.login-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; line-height: 1.5; text-align: center; }
.login-btn {
  width: 100%; padding: 12px 20px; background: var(--primary); color: white;
  border: none; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background 0.2s; margin-top: 4px; font-family: var(--font-body);
}
.login-btn:hover { background: var(--primary-dark); }
.login-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.login-forgot { display: block; text-align: center; margin-top: 14px; font-size: 13px; color: var(--accent); font-weight: 500; }
.login-forgot:hover { color: var(--accent-dark); text-decoration: underline; }
.login-message { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; display: none; }
.login-message.success { background: #D4EDDA; color: #155724; }
.login-message.error   { background: #F8D7DA; color: #721C24; }
.password-wrapper { position: relative; }
.toggle-password { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 13px; padding: 4px; }
.toggle-password:hover { color: var(--accent); }

/* ----- Header ----- */
.site-header {
  background: var(--primary); color: white; padding: 16px 24px;
  display: flex; align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.header-inner { width: 100%; max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.header-left { display: flex; align-items: center; gap: 16px; }
.header-title { font-size: 24px; font-weight: 700; color: white; letter-spacing: -0.5px; }
.header-back { color: rgba(255,255,255,0.7); font-size: 13px; transition: color 0.2s; }
.header-back:hover { color: white; text-decoration: none; }
.header-version { font-size: 12px; color: rgba(255,255,255,0.55); }
.sign-out-btn {
  background: rgba(255,255,255,0.15); color: white; padding: 5px 10px;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  transition: background 0.2s; border: 1px solid rgba(255,255,255,0.3);
}
.sign-out-btn:hover { background: rgba(255,255,255,0.25); color: white; }

/* ----- Layout ----- */
.container { max-width: 1200px; margin: 0 auto; padding: 32px 20px; }
.page-title { font-size: 28px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.page-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }

/* ----- Section Headings ----- */
.section-heading {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--primary); margin: 32px 0 12px; padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
  display: flex; justify-content: space-between; align-items: center;
}

/* ----- Cards ----- */
.card {
  background: var(--surface); border-radius: var(--radius); padding: 16px;
  border: 2px solid var(--accent);
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s, transform 0.3s;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card h2, .card h3 { color: var(--primary); margin-bottom: 8px; font-size: 16px; font-weight: 600; }
.card p { color: var(--text-muted); font-size: 13px; }

.card-neutral {
  background: var(--surface); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-neutral); border: 1px solid var(--border);
}

/* ----- App Card Grid ----- */
.app-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; padding-bottom: 6px; border-bottom: 2px solid var(--accent);
}
.app-section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--primary);
}
.app-section-count { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.app-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 16px; margin-bottom: 32px;
}
.app-card {
  background: var(--surface); border: 2px solid var(--accent);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow); transition: box-shadow 0.3s, transform 0.3s;
}
.app-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.app-card-icon {
  width: 52px; height: 52px; border-radius: 12px;
  background: rgba(13,148,136,0.1);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.app-card-title { font-size: 15px; font-weight: 700; color: var(--primary); line-height: 1.3; }
.app-card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; flex: 1; }

/* ----- Membership Card ----- */
.membership-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white; border-radius: var(--radius); padding: 20px 24px;
  box-shadow: var(--shadow-lg); margin-bottom: 24px;
  position: relative; overflow: hidden;
}
.membership-card::after { content: ''; position: absolute; top: -30px; right: -30px; width: 120px; height: 120px; background: rgba(255,255,255,0.06); border-radius: 50%; }
.membership-card .member-name { font-size: 18px; font-weight: 700; }

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: background 0.2s; text-decoration: none; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); color: white; text-decoration: none; }
.btn-navy { background: var(--primary); color: white; }
.btn-navy:hover { background: var(--primary-dark); color: white; text-decoration: none; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; text-decoration: none; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ----- Forms ----- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #555; margin-bottom: 6px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #ddd;
  border-radius: var(--radius-sm); font-size: 16px; font-family: var(--font-body);
  color: var(--text); background: var(--surface); transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-group textarea { min-height: 100px; resize: vertical; }

/* ----- Alerts ----- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.error-msg   { color: #c62828; font-size: 13px; margin-top: 12px; text-align: center; }
.success-msg { color: var(--accent); font-size: 13px; margin-top: 10px; font-weight: 500; }

/* ----- Badges ----- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-active   { background: #e6f4f1; color: var(--accent); }
.badge-inactive { background: #fce8e8; color: #c62828; }
.badge-pending  { background: #fef3c7; color: #92400e; }

/* ----- Spinner ----- */
.spinner { display: inline-block; width: 22px; height: 22px; border: 3px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- Resources ----- */
.resources-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.resource-item {
  background: var(--surface); border-radius: var(--radius); padding: 20px;
  border: 2px solid var(--accent); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.resource-item:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* ----- Account ----- */
.account-section { margin-bottom: 32px; }
.account-section h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--primary); margin-bottom: 12px; padding-bottom: 6px; border-bottom: 2px solid var(--accent); }
.account-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--divider); font-size: 13px; }
.account-row .key { color: var(--text-muted); font-weight: 500; }
.account-row .val { color: var(--text); font-weight: 600; }

/* ----- Site Footer ----- */
.site-footer {
  text-align: center; font-size: 12px; color: var(--text-muted);
  padding: 24px 20px 32px; border-top: 1px solid var(--divider); line-height: 1.8;
}
.site-footer a { color: var(--accent); }
.site-footer a:hover { color: var(--accent-dark); text-decoration: underline; }

/* ----- Responsive ----- */
@media (max-width: 640px) {
  .container { padding: 20px 16px; }
  .card-grid, .resources-grid { grid-template-columns: 1fr; }
  .site-header { padding: 12px 16px; }
  .header-title { font-size: 17px; }
  .header-version { display: none; }
  .btn { font-size: 13px; padding: 8px 14px; }
  .membership-card { padding: 18px 16px; }
  .login-card { padding: 28px 18px; }
}
@media (max-width: 480px) { .app-grid { grid-template-columns: 1fr; } }
@media (max-width: 400px) { .app-card { padding: 16px; } }
