/* ─── RESET & BASE ─── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: #4361ee;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ─── GLASSMORPHISM NAVBAR ─── */
.navbar {
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: white;
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4361ee, #7c3aed);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 10px rgba(67, 97, 238, 0.4);
}

.nav-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.nav-brand-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.nav-brand-subtitle {
    font-size: 10px;
    font-weight: 500;
    opacity: 0.5;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nav-brand-practice {
    font-size: 15px;
    font-weight: 700;
}

.nav-brand-logged-in {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.55;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    text-decoration: none;
}

.nav-user {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    margin-right: 6px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ─── LAYOUT ─── */
.container {
    max-width: 960px;
    margin: 32px auto;
    padding: 0 24px;
}

/* ─── CARDS WITH COLORED LEFT BORDER ─── */
.card {
    background: white;
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-left: 4px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.08);
}

.card-narrow {
    max-width: 480px;
    margin: 0 auto;
}

.card-blue   { border-left-color: #4361ee; }
.card-green  { border-left-color: #10b981; }
.card-red    { border-left-color: #ef4444; }
.card-yellow { border-left-color: #f59e0b; }

.card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f2f5;
}

.card-header-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.card-header-icon.blue   { background: linear-gradient(135deg, #eef2ff, #e0e7ff); }
.card-header-icon.red    { background: linear-gradient(135deg, #fef2f2, #fee2e2); }
.card-header-icon.green  { background: linear-gradient(135deg, #ecfdf5, #d1fae5); }
.card-header-icon.yellow { background: linear-gradient(135deg, #fffbeb, #fef3c7); }

.card-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.3;
}

.card-header p {
    font-size: 13px;
    color: #6b7280;
    margin: 2px 0 0 0;
}

/* ─── HEADINGS ─── */
h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
    background: #fafafa;
}

.form-group input:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
    background: white;
}

.form-group input::placeholder {
    color: #b0b7c3;
}

/* ─── SEGMENTED CONTROL (PILL TOGGLE) ─── */
.radio-group {
    display: flex;
    gap: 0;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 4px;
    position: relative;
}

.radio-option {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-option .radio-label {
    display: block;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.25s ease;
    text-transform: none;
    letter-spacing: 0;
    user-select: none;
}

.radio-option input[type="radio"]:checked + .radio-label {
    background: white;
    color: #4361ee;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #4361ee, #3b50d7);
    color: white;
    box-shadow: 0 2px 10px rgba(67, 97, 238, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(67, 97, 238, 0.45);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.45);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45);
}

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

.btn-delete:hover {
    background: #fee2e2;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* ─── ALERTS ─── */
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert::before {
    font-size: 18px;
    flex-shrink: 0;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.alert-success::before { content: "✓"; }

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.alert-danger::before { content: "✕"; }

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}
.alert-warning::before { content: "!"; }

/* ─── INITIALS AVATAR ─── */
.avatar-initials {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    text-transform: uppercase;
}

.avatar-initials.blue   { background: linear-gradient(135deg, #4361ee, #7c3aed); }
.avatar-initials.green  { background: linear-gradient(135deg, #10b981, #059669); }
.avatar-initials.red    { background: linear-gradient(135deg, #ef4444, #dc2626); }
.avatar-initials.yellow { background: linear-gradient(135deg, #f59e0b, #d97706); }

.avatar-initials-sm {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #4361ee, #7c3aed);
    text-transform: uppercase;
}

/* ─── PATIENT INFO ─── */
.patient-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: #f8fafc;
    padding: 24px;
    border-radius: 14px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.patient-details {
    flex: 1;
}

.patient-name {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 12px;
}

.patient-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.patient-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.patient-info-item .label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
}

.patient-info-item .value {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}

/* ─── DATA TABLE ─── */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    background: #f9fafb;
    border-bottom: 2px solid #f0f2f5;
    position: sticky;
    top: 64px;
    z-index: 10;
}

.data-table td {
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

.data-table tr:nth-child(even) td {
    background: #fafbfc;
}

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

.data-table tr:hover td {
    background: #f0f5ff;
}

/* ─── BADGES ─── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #ecfdf5; color: #065f46; }
.badge-danger  { background: #fef2f2; color: #991b1b; }

/* ─── ANIMATED RESULT SCREEN ─── */
.result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px auto;
    position: relative;
}

.result-icon.success {
    background: #ecfdf5;
    animation: resultPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-icon.fail {
    background: #fef2f2;
    animation: resultShake 0.5s ease;
}

.result-icon svg {
    width: 40px;
    height: 40px;
}

.result-icon.success svg {
    stroke: #10b981;
}

.result-icon.fail svg {
    stroke: #ef4444;
}

/* Checkmark draw animation */
.checkmark-path {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: drawCheck 0.6s 0.3s ease forwards;
}

.crossmark-path {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: drawCheck 0.4s 0.2s ease forwards;
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

@keyframes resultPop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes resultShake {
    0%, 100% { transform: translateX(0); }
    15%      { transform: translateX(-8px); }
    30%      { transform: translateX(8px); }
    45%      { transform: translateX(-6px); }
    60%      { transform: translateX(6px); }
    75%      { transform: translateX(-3px); }
    90%      { transform: translateX(3px); }
}

.result-title {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.result-subtitle {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 28px;
}

/* ─── LOGIN PAGE ─── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(-45deg, #0f0c29, #1a1a2e, #16213e, #0a1628);
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
    position: relative;
    overflow: hidden;
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-page::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(67, 97, 238, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(124, 58, 237, 0.06) 0%, transparent 50%);
    animation: gradientShift 8s ease infinite reverse;
}

.login-card {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    border-left: none;
}

.login-card:hover {
    transform: none;
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #4361ee, #7c3aed);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px auto;
    color: white;
    box-shadow: 0 4px 20px rgba(67, 97, 238, 0.4);
}

.login-logo h1 {
    font-size: 26px;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: -0.5px;
}

.login-logo p {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 6px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f0f2f5;
    font-size: 11px;
    color: #b0b7c3;
}

/* ─── EMPTY STATE ─── */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #9ca3af;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state p {
    font-size: 14px;
}

/* ─── CREATE CONTACT PROMPT ─── */
.create-prompt {
    text-align: center;
    padding: 24px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    margin-top: 20px;
    border-left: 4px solid #f59e0b;
}

.create-prompt p {
    font-size: 14px;
    color: #92400e;
    margin-bottom: 12px;
}

/* ─── DIVIDER ─── */
.divider {
    height: 1px;
    background: #e5e7eb;
    margin: 24px 0;
}

/* ─── FOOTER BRANDING ─── */
.page-footer {
    text-align: center;
    padding: 24px;
    font-size: 11px;
    color: #b0b7c3;
}

.page-footer a {
    color: #9ca3af;
    font-weight: 600;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
    .navbar { padding: 0 16px; }
    .nav-brand-title { font-size: 14px; }
    .container { padding: 0 16px; margin: 20px auto; }
    .card { padding: 24px; border-radius: 12px; }
    .patient-info-grid { grid-template-columns: 1fr; }
    .patient-card { flex-direction: column; align-items: center; text-align: center; }
    .btn-group { flex-direction: column; }
    .data-table th, .data-table td { padding: 10px 12px; font-size: 12px; }
    .nav-links a { padding: 8px 10px; font-size: 12px; }
}
