:root {
  --ink: #16334f;
  --muted: #62758a;
  --blue: #126d8c;
  --blue-deep: #0d4667;
  --mint: #e7f7ef;
  --amber: #fff1cf;
  --peach: #fff8ee;
  --line: #dceaf0;
  --danger: #b54747;
  --white: #ffffff;
  --shadow: 0 18px 46px rgba(22, 51, 79, 0.1);
}

* { box-sizing: border-box; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Poppins", Arial, sans-serif;
  background: #fff;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.page-shell { width: min(1100px, calc(100% - 40px)); margin: 0 auto; padding: 22px 0 50px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(22, 51, 79, 0.06);
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 1.16rem; font-weight: 800; }
.brand-mark {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-deep), var(--blue));
  box-shadow: 0 8px 18px rgba(18, 109, 140, 0.22);
}
.back-link, .logout-btn, .submit-btn, .ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.back-link, .ghost-button { border-color: #bad5df; color: var(--blue-deep); background: #fff; }
.submit-btn { color: #fff; background: var(--blue-deep); box-shadow: 0 9px 18px rgba(13, 70, 103, 0.18); }
.logout-btn { border-color: #f1c8c8; color: #9e3d3d; background: #fff8f8; }
.back-link:hover, .submit-btn:hover, .logout-btn:hover, .ghost-button:hover { transform: translateY(-2px); }
.submit-btn:hover { background: var(--blue); box-shadow: 0 12px 21px rgba(13, 70, 103, 0.24); }
.submit-btn:disabled, .logout-btn:disabled { cursor: wait; opacity: 0.65; transform: none; }

.access-layout { display: grid; grid-template-columns: minmax(290px, 0.78fr) minmax(0, 1.22fr); gap: 22px; margin-top: 24px; }
.welcome-panel, .form-panel, .account-panel, .content-card {
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
}
.welcome-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 510px;
  padding: clamp(26px, 5vw, 44px);
  color: #fff;
  background: radial-gradient(circle at 100% 0, rgba(255, 214, 118, 0.45), transparent 34%), linear-gradient(140deg, var(--blue-deep), var(--blue));
}
.form-panel, .account-panel, .content-card { padding: clamp(25px, 4.5vw, 40px); background: #fff; }
.form-panel { max-width: 720px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--blue); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.eyebrow::before { width: 9px; height: 9px; border-radius: 50%; background: #f6b84b; box-shadow: 0 0 0 5px #fff4dc; content: ""; }
.welcome-panel .eyebrow { color: #d9fff7; }
.welcome-panel .eyebrow::before { background: #ffd576; box-shadow: 0 0 0 5px rgba(255,255,255,0.13); }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { letter-spacing: -0.045em; }
h1 { margin: 17px 0 0; font-size: clamp(2.55rem, 5vw, 4.1rem); line-height: 1.02; }
h2 { margin: 14px 0 0; font-size: clamp(1.92rem, 3.8vw, 2.75rem); line-height: 1.1; }
.welcome-copy, .intro, .form-note, .form-status, .account-detail, .small-note { line-height: 1.7; }
.welcome-copy { max-width: 29ch; margin: 20px 0 0; color: rgba(255,255,255,0.82); }
.welcome-list { display: grid; gap: 12px; margin: 32px 0 0; padding: 0; list-style: none; }
.welcome-list li { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; font-weight: 600; }
.welcome-list li::before { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; color: var(--blue-deep); background: #fff; content: "✓"; }
.intro { max-width: 62ch; margin: 17px 0 0; color: var(--muted); }
.form-note, .small-note { margin: 16px 0 0; color: var(--muted); font-size: 0.78rem; }

.access-form { margin-top: 25px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.field-group { display: grid; gap: 8px; margin-top: 15px; color: var(--ink); font-size: 0.87rem; font-weight: 700; }
.field-group.full { grid-column: 1 / -1; }
.field-group input, .field-group select {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #cbdde5;
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-weight: 500;
}
.field-group input:focus, .field-group select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(18,109,140,0.12); }
.field-help { margin: 0; color: var(--muted); font-size: 0.73rem; font-weight: 500; line-height: 1.45; }
.photo-input { padding: 8px !important; }
.photo-preview { display: none; width: 80px; height: 80px; margin-top: 5px; border: 3px solid var(--mint); border-radius: 18px; object-fit: cover; }
.photo-preview.show { display: block; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 25px; }
.form-status { min-height: 1.7em; margin: 13px 0 0; color: #277255; font-size: 0.87rem; font-weight: 600; }
.form-status.error { color: var(--danger); }
.switch-copy { margin: 23px 0 0; color: var(--muted); font-size: 0.88rem; }
.text-link { color: var(--blue-deep); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

.account-panel { margin-top: 24px; }
.account-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.account-header h2 { max-width: 760px; }
.student-title-name { position: relative; display: inline-block; color: var(--blue-deep); }
.student-title-name::after { position: absolute; right: 0; bottom: 0.07em; left: 0; z-index: -1; height: 0.35em; border-radius: 999px; background: var(--amber); content: ""; }
.account-content { display: grid; grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr); gap: 20px; margin-top: 29px; }
.identity-card { position: relative; min-height: 428px; overflow: hidden; border: 4px solid #4bb7c2; border-radius: 28px; color: #fff; background: var(--blue-deep); box-shadow: 0 0 0 5px rgba(75,183,194,0.12), 0 20px 36px rgba(13,70,103,0.26); animation: student-status-glow 8s ease-in-out infinite; }
.identity-card::after { position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(8,43,66,0.18) 18%, rgba(8,43,66,0.02) 44%, rgba(8,43,66,0.88) 100%); content: ""; pointer-events: none; }
.identity-card__top { position: absolute; top: 20px; right: 20px; left: 20px; z-index: 2; display: flex; align-items: center; justify-content: center; padding: 9px 14px; border: 1px solid rgba(255,255,255,0.4); border-radius: 999px; background: rgba(13,70,103,0.35); font-size: 0.69rem; font-weight: 800; letter-spacing: 0.12em; text-align: center; text-transform: uppercase; backdrop-filter: blur(8px); }
.identity-card__body { position: absolute; inset: 0; }
.profile-photo { display: block; width: 100%; height: 100%; object-fit: cover; background: #d9f1f4; }
.student-card-caption { position: absolute; right: 20px; bottom: 22px; left: 20px; z-index: 2; padding: 14px 16px; border: 1px solid rgba(255,255,255,0.48); border-radius: 17px; background: rgba(255,255,255,0.16); text-align: center; backdrop-filter: blur(10px); }
.student-name { margin: 0; color: #fff; font-size: clamp(1.32rem, 2vw, 1.65rem); line-height: 1.22; text-shadow: 0 2px 12px rgba(0,0,0,0.38); }
.student-standard { margin: 6px 0 0; color: #e4fffb; font-size: 0.84rem; font-weight: 700; }
@keyframes student-status-glow { 0%, 100% { border-color: #4bb7c2; box-shadow: 0 0 0 5px rgba(75,183,194,0.12), 0 20px 36px rgba(13,70,103,0.26); } 33% { border-color: #f3c86a; box-shadow: 0 0 0 5px rgba(243,200,106,0.16), 0 20px 36px rgba(13,70,103,0.26); } 66% { border-color: #78ca9a; box-shadow: 0 0 0 5px rgba(120,202,154,0.16), 0 20px 36px rgba(13,70,103,0.26); } }
.summary-stack { display: grid; gap: 16px; }
.summary-card { padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.summary-card--astrology { position: relative; min-height: 300px; padding-right: 242px; background: linear-gradient(135deg, #fffdf6, #fff8e7); border-color: #f3dfa8; }
.summary-card h3 { margin: 0; font-size: 1.04rem; }
.summary-card--astrology h3 { color: #7d5a13; font-size: 1.55rem; letter-spacing: -0.04em; }
.summary-card--astrology h3 span { display: block; margin-top: 3px; color: #9a7a3a; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.summary-card p { margin: 9px 0 0; color: var(--muted); font-size: 0.86rem; line-height: 1.7; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 15px; }
.fact { padding: 11px; border: 1px solid rgba(222,188,102,0.45); border-radius: 12px; background: rgba(255,255,255,0.6); }
.fact span { display: block; color: #8a6d2d; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.fact strong { display: block; margin-top: 4px; font-size: 0.82rem; line-height: 1.35; }
.facts--compact { position: absolute; top: 20px; right: 20px; width: 204px; margin: 0; gap: 6px; }
.facts--compact .fact { padding: 8px 7px; text-align: center; }
.facts--compact .fact span { font-size: 0.52rem; letter-spacing: 0.04em; }
.facts--compact .fact strong { margin-top: 3px; font-size: 0.66rem; overflow-wrap: anywhere; }
.graha-copy { margin-top: 26px; }
.graha-copy > p { color: #695835; font-weight: 700; }
.graha-observations { display: grid; gap: 10px; margin-top: 14px; }
.graha-observation { padding: 13px 14px; border-left: 3px solid #d7ad4d; border-radius: 0 12px 12px 0; background: rgba(255,255,255,0.58); }
.graha-observation strong { color: #7d5a13; font-size: 0.78rem; }
.graha-observation p { margin: 5px 0 0; color: #6c6250; font-size: 0.78rem; line-height: 1.55; }
.summary-card--astrology.summary-card--compact { padding: 22px; min-height: 0; }
.summary-card--compact .graha-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.summary-card--compact #grahaFacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.graha-facts .fact { text-align: center; overflow-wrap: anywhere; }
.score-card-button { display: inline-flex; margin-top: 12px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--blue-deep); font-size: .74rem; font-weight: 600; background: #f5fafb; }
.score-card-button:hover { background: var(--mint); }
.score-filters { display: flex; flex-wrap: wrap; gap: 14px; margin: 20px 0; }
.score-filters label { display: grid; gap: 7px; flex: 1 1 200px; font-size: .85rem; }
.score-filters select { width: 100%; padding: 11px; font: inherit; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; }
.score-table-wrap { overflow-x: auto; }
.score-table { width: 100%; border-collapse: collapse; font-size: .84rem; text-align: left; }
.score-table th, .score-table td { padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.score-table th { color: var(--blue-deep); background: #f5fafb; }
.score-table caption { text-align: left; padding: 12px 0; color: var(--muted); }
.teacher-shell { width: min(1500px, calc(100% - 32px)); }
.teacher-shell h1 { font-size: clamp(1.4rem, 3vw, 2rem); }
.teacher-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.teacher-metrics div { display: grid; gap: 5px; padding: 15px; border: 1px solid var(--line); background: #f5fafb; border-radius: 12px; }
.teacher-metrics strong { color: var(--blue-deep); font-size: 1.5rem; }
.teacher-metrics span, .teacher-note { font-size: .8rem; color: var(--muted); }
.teacher-table-wrap { max-height: 70vh; margin-top: 20px; }
.teacher-table-wrap thead { position: sticky; top: 0; background: #fff; }
.teacher-table-wrap td { vertical-align: top; }
.teacher-table-wrap small { display: block; margin-top: 7px; font-size: .65rem; color: var(--muted); }
.teacher-table-wrap .teacher-feedback { min-width: 270px; max-width: 380px; white-space: normal; }
.teacher-feedback p { margin: 0; }
.teacher-table-wrap details { white-space: normal; min-width: 180px; max-width: 330px; overflow-wrap: anywhere; }
.teacher-table-wrap summary { cursor: pointer; color: var(--blue-deep); }
.teacher-shell input { padding: 11px; font: inherit; border: 1px solid var(--line); border-radius: 9px; }
@media(max-width:540px) { .teacher-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); } }
.need-more { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; margin-top: 16px; padding: 0 14px; border-radius: 11px; color: #fff; background: var(--blue-deep); font-size: 0.82rem; font-weight: 700; }
.academics { grid-column: 1 / -1; padding: 24px; border: 1px solid var(--line); border-radius: 21px; background: #fbfffd; }
.academics h3 { margin: 0; font-size: 1.07rem; }
.academics p { margin: 8px 0 0; color: var(--muted); font-size: 0.86rem; line-height: 1.65; }
.subject-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.subject-list li { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 0.86rem; font-weight: 700; }
.subject-list small { display: block; margin-top: 4px; color: var(--muted); font-size: 0.72rem; font-weight: 500; }
.subject-list progress { display: block; width: 100%; height: 10px; margin-top: 12px; accent-color: var(--blue-deep); }
.subject-list details { margin-top: 12px; font-weight: 400; }
.subject-list summary { cursor: pointer; color: var(--blue-deep); }
.graha-method { font-size: .72rem; line-height: 1.6; color: var(--muted); }
.kendra-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.career-support[hidden], .career-support [hidden] { display: none !important; }
.career-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-top: 16px; }
.career-controls label { display: grid; gap: 8px; flex: 1 1 240px; font-size: .85rem; }
.career-controls select { width: 100%; min-width: 0; padding: 12px; font: inherit; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.career-test, .career-report, #careerAcademic { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow-wrap: anywhere; }
.career-test h4, .career-report h4 { margin: 0; font-size: 1rem; }
.career-test fieldset { border: none; margin: 20px 0; padding: 0; min-width: 0; }
.career-test legend { line-height: 1.65; font-weight: 600; font-size: .9rem; }
.career-option { display: flex; gap: 10px; align-items: start; padding: 12px; margin-top: 9px; border: 1px solid var(--line); border-radius: 10px; font-size: .85rem; line-height: 1.6; cursor: pointer; }
.career-option input { margin-top: 5px; flex-shrink: 0; accent-color: var(--blue-deep); }
.career-navigation { display: flex; gap: 8px; flex-wrap: wrap; }
.career-history { margin-top: 20px; font-size: .85rem; }
.career-history summary { cursor: pointer; font-weight: 600; }
.career-history li { margin-top: 10px; }
.career-support .career-disclaimer { font-size: .75rem; }
.career-support .error { color: #a83232; }
.career-support button:disabled { cursor: wait; opacity: .6; }
.adhyayan { background: #fff; }
.adhyayan [hidden], #tutorUpdateForm[hidden] { display: none !important; }
#tutorUpdateForm textarea { width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.tutor-management { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #f5fafb; }
.tutor-management summary { cursor: pointer; font-weight: 600; color: var(--blue-deep); }
.tutor-management h4 { margin: 0 0 12px; }
.tutor-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.tutor-toolbar [aria-pressed="true"] { background: var(--blue-deep); color: #fff; }
.tutor-note-form { margin-top: 15px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.tutor-note-form label { display: grid; gap: 6px; margin-bottom: 12px; font-size: .85rem; }
.tutor-add-form select { padding: 12px; border: 1px solid var(--line); border-radius: 9px; font: inherit; max-width: 100%; }
.tutor-add-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 14px; }
.tutor-add-form label { flex: 1 1 180px; display: grid; gap: 6px; font-size: .82rem; }
.adhyayan input, .adhyayan textarea { box-sizing: border-box; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 9px; font: inherit; }
.tutor-list { list-style: none; padding: 0; }
.tutor-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 10px; }
.tutor-list span { flex: 1 1 200px; font-size: .85rem; }
.kendra-section { margin-top: 22px; }
.kendra-section h4 { margin: 0 0 8px; color: var(--blue-deep); }
.tutor-update, .resource-card { border: 1px solid var(--line); border-radius: 12px; padding: 15px; margin-top: 10px; overflow-wrap: anywhere; }
.tutor-update h5 { font-size: .88rem; margin: 0; }
.tutor-update p { white-space: pre-wrap; }
.tutor-update small, .resource-card small { color: var(--muted); display: block; font-size: .75rem; }
.resource-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.resource-card img { width: 100%; height: 150px; object-fit: contain; background: #f7fafb; border-radius: 8px; }
.resource-card a { display: block; margin: 10px 0; color: var(--blue-deep); font-weight: 600; }
#kendraStatus.error { color: #a83232; }
#trajectoryResult, #simulationResult { padding: 16px; margin-top: 12px; background: #eef7f7; border-radius: 12px; }
#academicSimulator { margin-top: 22px; }
#academicSimulator summary { cursor: pointer; font-weight: 700; color: var(--ink); }
#simulationInputs label { display: grid; gap: 8px; font-size: .85rem; }
#simulationInputs input { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
#academicSimulationForm button { margin-top: 16px; cursor: pointer; border: 0; font: inherit; }
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.contact-card { width: min(630px, 100%); margin: 25px auto 0; text-align: center; }
.contact-card h2 { margin-top: 14px; }
.contact-value { display: inline-block; margin-top: 14px; padding: 12px 17px; border-radius: 12px; color: var(--blue-deep); background: var(--mint); font-weight: 800; }

@media (max-width: 820px) { .access-layout, .account-content { grid-template-columns: 1fr; } .welcome-panel { min-height: auto; } .account-header { display: grid; } .summary-card--astrology { min-height: 300px; padding-right: 226px; } .facts--compact { position: absolute; top: 20px; right: 20px; width: 194px; margin: 0; } }
@media (max-width: 540px) {
  .page-shell { width: min(100% - 24px, 1100px); padding-top: 12px; }
  .topbar { padding: 10px; border-radius: 16px; }
  .brand { font-size: 1rem; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
  .back-link { min-height: 39px; padding: 0 10px; font-size: 0.78rem; }
  .form-grid { grid-template-columns: 1fr; }
  .field-group.full { grid-column: auto; }
  .form-panel, .account-panel, .content-card { padding: 23px; border-radius: 21px; }
  .facts, .subject-list { grid-template-columns: 1fr; }
  .facts--compact { grid-template-columns: repeat(3, 1fr); }
  .identity-card { min-height: 390px; }
}
@media (max-width: 440px) { .summary-card--astrology { min-height: 0; padding-right: 22px; } .facts--compact { position: static; width: auto; margin-top: 17px; } }
