/* ===== MOBILE.CSS — iPhone-first clinic UI ===== */
@import url('https://fonts.googleapis.com/css2?family=SF+Pro+Display:wght@400;500;600;700&display=swap');

:root {
    --bg: #F2F2F7;
    --card: #FFFFFF;
    --primary: #007AFF;
    --primary-light: #E8F2FF;
    --danger: #FF3B30;
    --danger-light: #FFF0EF;
    --success: #34C759;
    --success-light: #EDFBF1;
    --warning: #FF9500;
    --text: #1C1C1E;
    --text-secondary: #8E8E93;
    --text-tertiary: #AEAEB2;
    --separator: #E5E5EA;
    --fill: #F2F2F7;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --safe-bottom: env(safe-area-inset-bottom, 20px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 17px;
    line-height: 1.4;
    min-height: 100vh;
    padding-bottom: calc(20px + var(--safe-bottom));
}

/* ===== NAVIGATION BAR ===== */
.nav-bar {
    background: rgba(242,242,247,0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 16px 8px;
    border-bottom: 0.5px solid var(--separator);
}

.nav-bar .nav-title {
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    color: var(--text);
}

.nav-bar .nav-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 2px;
}

.nav-bar .nav-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.nav-back {
    color: var(--primary);
    font-size: 17px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
}

.nav-back::before { content: '‹'; font-size: 22px; line-height: 1; }

/* ===== DATE NAV ===== */
.date-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--card);
    border-bottom: 0.5px solid var(--separator);
}

.date-nav-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}
.date-nav-btn:active { background: #d0e6ff; }

.date-display {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
}

/* ===== CARDS / LIST GROUPS ===== */
.list-section {
    margin: 20px 16px 0;
}

.list-section-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 8px;
    padding: 0 4px;
}

.list-group {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.list-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 0.5px solid var(--separator);
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    min-height: 52px;
    transition: background 0.1s;
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: var(--fill); }

.list-item .item-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.item-icon.green { background: var(--success); }
.item-icon.red { background: var(--danger); }
.item-icon.blue { background: var(--primary); }
.item-icon.orange { background: var(--warning); }

.list-item .item-content { flex: 1; min-width: 0; }
.list-item .item-title { font-size: 17px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .item-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }
.list-item .item-right { color: var(--text-tertiary); font-size: 17px; }

/* ===== SCHEDULE TIME SLOTS ===== */
.slot {
    display: flex;
    align-items: stretch;
    padding: 0;
    border-bottom: 0.5px solid var(--separator);
    min-height: 60px;
}
.slot:last-child { border-bottom: none; }

.slot-time {
    width: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    border-right: 0.5px solid var(--separator);
    background: var(--fill);
    padding: 10px 4px;
}

.slot-content {
    flex: 1;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.slot.free .slot-time { color: var(--text-tertiary); }
.slot.busy { background: #fff; }
.slot.busy .slot-time { color: var(--primary); background: var(--primary-light); }

.slot-patient { font-size: 16px; font-weight: 500; }
.slot-procedures { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.slot-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ===== PILL BADGES ===== */
.badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    background: var(--primary-light);
    color: var(--primary);
}
.badge-pill.red { background: var(--danger-light); color: var(--danger); }
.badge-pill.green { background: var(--success-light); color: var(--success); }

/* ===== BUTTONS ===== */
.btn-ios {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 17px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    width: 100%;
    transition: opacity 0.15s;
    text-decoration: none;
}
.btn-ios:active { opacity: 0.7; }
.btn-ios.primary { background: var(--primary); color: #fff; }
.btn-ios.danger { background: var(--danger); color: #fff; }
.btn-ios.secondary { background: var(--card); color: var(--primary); border: 1.5px solid var(--separator); }
.btn-ios.sm { padding: 8px 14px; font-size: 15px; border-radius: 8px; width: auto; }
.btn-ios.sm.danger { background: var(--danger-light); color: var(--danger); }
.btn-ios.sm.info { background: var(--primary-light); color: var(--primary); }

/* ===== FORMS ===== */
.form-section {
    margin: 20px 16px 0;
}

.form-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.form-row {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    border-bottom: 0.5px solid var(--separator);
    gap: 6px;
}
.form-row:last-child { border-bottom: none; }

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-input {
    font-size: 17px;
    color: var(--text);
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    padding: 4px 0;
    -webkit-appearance: none;
    font-family: inherit;
}

.form-input::placeholder { color: var(--text-tertiary); }

.form-select {
    font-size: 17px;
    color: var(--text);
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    padding: 4px 0;
    -webkit-appearance: none;
    font-family: inherit;
}

.form-textarea {
    font-size: 17px;
    color: var(--text);
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    resize: none;
    min-height: 80px;
    font-family: inherit;
    line-height: 1.4;
}

/* ===== PROCEDURE CHECKBOXES ===== */
.procedure-check {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 0.5px solid var(--separator);
    gap: 12px;
    cursor: pointer;
}
.procedure-check:last-child { border-bottom: none; }

.procedure-check input[type="checkbox"] {
    width: 22px; height: 22px;
    accent-color: var(--primary);
    border-radius: 6px;
    flex-shrink: 0;
    cursor: pointer;
}

.procedure-check-label { flex: 1; }
.procedure-check-name { font-size: 17px; font-weight: 500; }
.procedure-check-price { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }

/* ===== COMMENT CARDS ===== */
.comment-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    margin-bottom: 10px;
}
.comment-procedure { font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: 6px; }
.comment-text { font-size: 16px; line-height: 1.5; }
.comment-date { font-size: 13px; color: var(--text-tertiary); margin-top: 6px; }

/* ===== LOGIN ===== */
.login-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background: var(--bg);
}

.login-logo {
    width: 80px; height: 80px;
    background: linear-gradient(145deg, #007AFF, #5AC8FA);
    border-radius: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: 40px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0,122,255,0.3);
}

.login-title { font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.login-sub { font-size: 15px; color: var(--text-secondary); margin-bottom: 40px; }

.login-card {
    background: var(--card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 380px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.login-field {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 0.5px solid var(--separator);
    gap: 12px;
}
.login-field:last-child { border-bottom: none; }
.login-field-icon { font-size: 20px; width: 24px; text-align: center; }
.login-field input {
    flex: 1;
    font-size: 17px;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    color: var(--text);
}
.login-field input::placeholder { color: var(--text-tertiary); }

.error-banner {
    background: var(--danger-light);
    color: var(--danger);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    width: 100%;
    max-width: 380px;
    text-align: center;
    margin-bottom: 16px;
}

/* ===== PATIENT INFO ===== */
.patient-header {
    background: linear-gradient(145deg, var(--primary), #5AC8FA);
    padding: 24px 16px 20px;
    color: #fff;
}
.patient-avatar {
    width: 64px; height: 64px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    margin-bottom: 12px;
}
.patient-name { font-size: 22px; font-weight: 700; }
.patient-phone { font-size: 15px; opacity: 0.85; margin-top: 4px; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .empty-title { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state .empty-sub { font-size: 15px; }

/* ===== SPACERS ===== */
.spacer-sm { height: 10px; }
.spacer { height: 20px; }
.spacer-lg { height: 32px; }
.px-16 { padding: 0 16px; }
