/* Modern Vanilla CSS Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --soft-navy: #1F2A44;
    --lime-signal: #E1FF7C;
    --calm-mint: #4AD1B0;
    --cool-charcoal: #2E2E2E;
    --off-white: #F3F4F6;
    --border-color: #DBDBDB;

    --bg-gradient-start: var(--off-white);
    --bg-gradient-end: #E5E7EB;
    --card-bg: #FFFFFF;
    --card-border: var(--border-color);
    --text-primary: var(--cool-charcoal);
    --text-secondary: #4B5563;
    --primary: var(--soft-navy);
    --primary-hover: #162035;
    --accent: var(--calm-mint);
    --success: var(--calm-mint);
    --error: #EF4444;
    --input-bg: #FFFFFF;
    --input-border: var(--border-color);
    --input-focus: var(--calm-mint);
    --header-bg: rgba(255, 255, 255, 0.85);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    min-height: 100vh;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

header {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    background: linear-gradient(to right, var(--soft-navy), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a, .nav-links span {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.btn-logout {
    background: rgba(74, 209, 176, 0.15);
    color: var(--accent) !important;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid rgba(74, 209, 176, 0.3);
    font-weight: 500;
    transition: all 0.3s ease !important;
}

.btn-logout:hover {
    background: var(--accent);
    color: #fff !important;
}

.btn-register-header {
    background: linear-gradient(135deg, var(--accent) 0%, #35b394 100%);
    color: #ffffff !important;
    padding: 0.55rem 1.4rem;
    font-size: 0.9rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(74, 209, 176, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-register-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: all 0.6s ease;
}

.btn-register-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(74, 209, 176, 0.45);
    filter: brightness(1.05);
}

.btn-register-header:hover::before {
    left: 100%;
}

.btn-register-header:active {
    transform: translateY(0);
}

.btn-register-header svg {
    transition: transform 0.3s ease;
}

.btn-register-header:hover svg {
    transform: rotate(90deg);
}

.btn-login-header {
    background: transparent;
    color: var(--text-secondary) !important;
    border: 1.5px solid var(--border-color);
    padding: 0.55rem 1.4rem;
    font-size: 0.9rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-login-header:hover {
    background: rgba(31, 42, 68, 0.04);
    border-color: var(--primary);
    color: var(--primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.btn-login-header:active {
    transform: translateY(0);
}

.btn-login-header svg {
    transition: transform 0.3s ease;
}

.btn-login-header:hover svg {
    transform: translateX(-2px);
}

/* Sidebar Layout */
.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--soft-navy);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border-right: 3px solid var(--calm-mint);
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #FFFFFF;
}

.logo-img {
    height: 35px;
    width: auto;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.sidebar-menu a {
    color: #94A3B8;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar-menu a:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-menu a.active {
    color: var(--soft-navy);
    background: var(--lime-signal);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(225, 255, 124, 0.2);
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #94A3B8;
}

.btn-logout-sidebar {
    background: var(--calm-mint);
    color: var(--soft-navy) !important;
    text-align: center;
    padding: 0.6rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-logout-sidebar:hover {
    background: #3cbfa0;
    box-shadow: 0 4px 10px rgba(74, 209, 176, 0.3);
}

.app-main-content {
    background: var(--off-white);
    padding: 3rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 1rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

.card-large {
    max-width: 1300px;
}

.card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
}

.card-subtitle {
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* Stepper Progress Bar */
.stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
}

.stepper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--input-border);
    z-index: 1;
}

.step-node {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--bg-gradient-start);
    border: 2px solid var(--input-border);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    color: var(--text-secondary);
    z-index: 2;
    transition: all 0.3s ease;
}

.step-node.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.step-node.completed {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    flex: 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--input-border);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Alert Boxes */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

/* Preview Layout */
.preview-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--input-border);
}

.preview-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-grid {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 0.75rem 1.5rem;
    font-size: 0.95rem;
}

.preview-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.preview-value {
    color: var(--text-primary);
}

.preview-link-edit {
    font-size: 0.85rem;
    color: var(--input-focus);
    text-decoration: none;
}

.preview-link-edit:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background: rgba(15, 23, 42, 0.03);
    border-top: 1px solid var(--card-border);
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Heartbeat Preloader Styling */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-gradient-start);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.heartbeat-container {
    text-align: center;
}

.heartbeat-svg {
    width: 180px;
    height: 120px;
}

.heartbeat-path {
    stroke: var(--accent);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: draw-heartbeat 1.8s linear infinite;
}

.heartbeat-text {
    margin-top: 1.5rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes draw-heartbeat {
    0% {
        stroke-dashoffset: 800;
    }
    70% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -800;
    }
}

@keyframes pulse-text {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Auth Shell Split-Panel Layout (From login-preview.html) */
:root {
  --navy: #0B2545;
  --teal: #146C74;
  --teal-light: #1E8A93;
  --gold: #C99A3D;
  --mint: #EAF4F3;
  --ink: #16222F;
  --gray: #5C6B73;
  --line: #DCE6E5;
}

/* Custom font import for auth pages */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap');

.auth-shell {
  width:100%;
  max-width:960px;
  min-height:600px;
  background:#fff;
  border-radius:20px;
  overflow:hidden;
  display:grid;
  grid-template-columns:1fr 1fr;
  box-shadow:0 30px 60px -20px rgba(11,37,69,0.35);
}

/* LEFT BRAND PANEL */
.brand-panel {
  background:linear-gradient(155deg,var(--navy) 0%,var(--teal) 100%);
  color:#fff;
  padding:52px 44px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  position:relative;
  overflow:hidden;
}

.brand-panel::before {
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 85% 10%, rgba(201,154,61,0.18), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(255,255,255,0.06), transparent 40%);
  pointer-events:none;
}

.brand-top {position:relative; z-index:1;}

.brand-logo-row {
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:44px;
}

.brand-logo-badge {
  width:46px;height:46px;
  border-radius:12px;
  background:rgba(255,255,255,0.12);
  border:1px solid rgba(255,255,255,0.25);
  display:flex;align-items:center;justify-content:center;
  font-family:'Fraunces',serif;
  font-weight:600;
  font-size:1.1rem;
  color: #fff;
}

.brand-logo-row span {
  font-size:0.78rem;
  letter-spacing:0.14em;
  text-transform:uppercase;
  color:rgba(255,255,255,0.7);
  font-family:'IBM Plex Mono',monospace;
}

.brand-headline {
  font-family:'Fraunces',serif;
  font-size:2.1rem;
  font-weight:600;
  line-height:1.25;
  margin:0 0 14px;
  color: #fff !important;
}

.brand-sub {
  font-size:0.95rem;
  line-height:1.6;
  color:rgba(255,255,255,0.72);
  max-width:340px;
}

/* ECG signature element */
.ecg-wrap {
  position:relative;
  z-index:1;
  margin:36px 0 8px;
  height:70px;
}

.ecg-svg {width:100%; height:100%; overflow:visible;}

.ecg-line {
  fill:none;
  stroke:var(--gold);
  stroke-width:2.5;
  stroke-linecap:round;
  stroke-linejoin:round;
  stroke-dasharray:360;
  stroke-dashoffset:360;
  animation:draw-ecg 2.6s ease-in-out infinite;
  filter:drop-shadow(0 0 6px rgba(201,154,61,0.55));
}

@keyframes draw-ecg {
  0%{stroke-dashoffset:360;}
  45%{stroke-dashoffset:0;}
  100%{stroke-dashoffset:-360;}
}

.brand-foot {
  position:relative; z-index:1;
  display:flex;
  gap:28px;
  padding-top:22px;
  border-top:1px solid rgba(255,255,255,0.15);
  font-family:'IBM Plex Mono',monospace;
  font-size:0.72rem;
  color:rgba(255,255,255,0.55);
  letter-spacing:0.03em;
}

.brand-foot b {
  color:rgba(255,255,255,0.85); 
  display:block; 
  font-family:'Inter', sans-serif; 
  font-size:0.9rem; 
  font-weight:600;
}

/* RIGHT FORM PANEL */
.form-panel {
  padding:56px 48px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  background: #ffffff;
}

.form-eyebrow {
  font-family:'IBM Plex Mono',monospace;
  font-size:0.72rem;
  letter-spacing:0.12em;
  text-transform:uppercase;
  color:var(--teal);
  margin-bottom:10px;
  display:flex;
  align-items:center;
  gap:8px;
  font-weight: 600;
}

.form-eyebrow::before {
  content:"";
  width:16px;height:1px;background:var(--gold);
}

.form-title {
  font-family:'Fraunces',serif;
  font-size:1.6rem;
  font-weight:600;
  color:var(--navy);
  margin:0 0 6px;
}

.form-desc {
  color:var(--gray);
  font-size:0.9rem;
  margin:0 0 32px;
}

.field {
  position:relative;
  margin-bottom:20px;
}

.field input,
.field select {
  width:100%;
  padding:16px 14px 8px;
  border:1.5px solid var(--line);
  border-radius:10px;
  font-size:0.95rem;
  font-family:'Inter',sans-serif;
  color:var(--ink);
  background:#fff;
  transition:border-color .15s ease;
}

.field input:focus,
.field select:focus {
  outline:none;
  border-color:var(--teal);
  box-shadow:0 0 0 3px rgba(20,108,116,0.12);
}

.field label {
  position:absolute;
  left:14px; top:16px;
  font-size:0.95rem;
  color:var(--gray);
  pointer-events:none;
  transition:all .15s ease;
  background:transparent;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field select:focus + label,
.field select:valid + label {
  top:6px;
  font-size:0.68rem;
  letter-spacing:0.04em;
  text-transform:uppercase;
  color:var(--teal);
  font-weight:600;
}

.field input::placeholder {color:transparent;}

.btn-login {
  width:100%;
  padding:15px;
  border:none;
  border-radius:10px;
  background:linear-gradient(135deg,var(--navy),var(--teal));
  color:#fff;
  font-size:0.95rem;
  font-weight:600;
  letter-spacing:0.02em;
  cursor:pointer;
  box-shadow:0 10px 24px -8px rgba(20,108,116,0.55);
  transition:transform .15s ease, box-shadow .15s ease;
  display:flex; align-items:center; justify-content:center; gap:8px;
}

.btn-login:hover {transform:translateY(-1px); box-shadow:0 14px 28px -8px rgba(20,108,116,0.65);}
.btn-login:active {transform:translateY(0);}

.divider {
  display:flex; align-items:center; gap:12px;
  margin:26px 0 20px;
  color:var(--gray);
  font-size:0.78rem;
}

.divider::before, .divider::after {
  content:""; flex:1; height:1px; background:var(--line);
}

.register-link {
  text-align:center;
  font-size:0.88rem;
  color:var(--gray);
}

.register-link a {color:var(--gold); font-weight:600; text-decoration:none;}
.register-link a:hover {text-decoration:underline;}

@media (max-width:768px) {
  .auth-shell {grid-template-columns:1fr;}
  .brand-panel {padding:36px;}
  .brand-headline {font-size:1.6rem;}

  /* Dashboard & Steps Layout responsiveness */
  .app-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 3px solid var(--calm-mint);
    padding: 1rem;
  }
  
  .sidebar-logo {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    justify-content: center;
  }
  
  .sidebar-menu {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
  
  .sidebar-menu li {
    flex: 1 1 auto;
  }
  
  .sidebar-menu a {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    text-align: center;
  }
  
  .sidebar-footer {
    text-align: center;
    align-items: center;
    padding-top: 0.5rem;
  }
  
  .app-main-content {
    padding: 1.5rem 1rem;
  }
  
  .card {
    padding: 1.5rem 1rem;
  }
}

/* Toaster Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}
.toast {
    background: #ffffff;
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}
.toast-success {
    border-left-color: var(--calm-mint);
}
.toast-error {
    border-left-color: var(--error);
}
