:root {
    --cc-primary: #1a2942;
    --cc-accent: #2c7be5;
    --cc-danger: #e63946;
    --cc-success: #2a9d8f;
    --cc-info: #457b9d;
    --cc-light: #f1faee;
    --cc-alert-bg: #dc3545;
    --cc-patho-bg: #0d6efd;
    --cc-treat-bg: #198754;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Dynamic form rows */
.dynamic-row {
    position: relative;
    padding: 12px 40px 12px 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.dynamic-row .btn-remove-row {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    z-index: 2;
}

.row-template {
    display: none !important;
}

/* Profile completeness */
.completeness-bar {
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    overflow: hidden;
}

.completeness-bar .fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* Emergency page */
.emergency-container {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
}

.emergency-header {
    background: #fff;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
}

.emergency-header .carecode-logo {
    height: 28px;
}

.patient-section {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.patient-photo img {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
}

.patient-photo .no-photo {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #adb5bd;
}

.patient-info h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--cc-primary);
}

.patient-info .dob {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0;
}

.patient-info .blood-badge {
    display: inline-block;
    background: var(--cc-danger);
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-top: 4px;
}

.btn-emergency-call {
    background: var(--cc-danger);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    width: calc(100% - 40px);
    margin: 0 20px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    transition: transform 0.15s;
}

.btn-emergency-call:hover {
    color: #fff;
    transform: scale(1.02);
}

/* Colored sections */
.em-section {
    margin-bottom: 0;
}

.em-section-header {
    padding: 10px 20px;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.em-section-body {
    padding: 12px 20px;
}

.em-section-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.em-section-body li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-size: 0.95rem;
}

.em-section-body li:last-child {
    border-bottom: none;
}

.section-alerts .em-section-header { background: #dc3545; color: #fff; }
.section-alerts .em-section-body { background: #fde8ea; }
.section-patho .em-section-header { background: #457b9d; color: #fff; }
.section-patho .em-section-body { background: #e8f0f6; }
.section-treat .em-section-header { background: #2a9d8f; color: #fff; }
.section-treat .em-section-body { background: #e6f5f2; }
.section-instructions .em-section-header { background: #e9ecef; color: #333; }
.section-instructions .em-section-body { background: #f8f9fa; }
.section-contacts .em-section-header { background: #e9ecef; color: #333; }
.section-contacts .em-section-body { background: #f8f9fa; }

.section-contacts a {
    color: var(--cc-primary);
    text-decoration: none;
    font-weight: 500;
}

.section-contacts a:hover {
    text-decoration: underline;
}

/* Landing page */
.hero-section {
    background: linear-gradient(135deg, var(--cc-primary), var(--cc-accent));
    color: #fff;
    padding: 80px 0;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 800;
}

.feature-card {
    text-align: center;
    padding: 30px 20px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}

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

.feature-card .icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 16px;
}

/* Business card */
.bcard-container {
    width: 340px;
    height: 220px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: relative;
    background: #fff;
}

/* Login / Register */
.auth-container {
    max-width: 440px;
    margin: 0 auto;
}
