/* =============================================
   Krankenfahrt Fare Calculator - Glassmorphism Theme
   Color Palette: Orange (#FF6B35) + White + Glass
   ============================================= */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS Variables ---- */
:root {
    --primary: #FF6B35;
    --primary-light: #FF9A56;
    --primary-dark: #E55A25;
    --primary-glow: rgba(255, 107, 53, 0.3);
    --primary-subtle: rgba(255, 107, 53, 0.08);
    --white: #FFFFFF;
    --bg-light: #FFF8F4;
    --bg-gradient: linear-gradient(135deg, #FFF8F4 0%, #FFE8DB 50%, #FFF0E8 100%);
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px rgba(255, 107, 53, 0.08);
    --text-dark: #1A1A2E;
    --text-medium: #4A4A6A;
    --text-light: #8888AA;
    --border-light: rgba(255, 107, 53, 0.15);
    --success: #2ECC71;
    --error: #E74C3C;
    --radius: 20px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-dark);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ---- Animated Background Shapes ---- */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

body::before {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.12) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    animation: floatBlob 15s ease-in-out infinite;
}

body::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 154, 86, 0.1) 0%, transparent 70%);
    bottom: -80px;
    left: -80px;
    animation: floatBlob 20s ease-in-out infinite reverse;
}

@keyframes floatBlob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ---- Main Container ---- */
.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 4px 20px 10px;
    position: relative;
    z-index: 1;
}

/* ---- Header ---- */
.header {
    text-align: center;
    margin-bottom: 4px;
    position: relative;
}

.header-top {
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 200;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 2px solid var(--border-light);
    border-radius: 50px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.5px;
}

.lang-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.lang-btn svg {
    width: 16px;
    height: 16px;
}

.logo-icon {
    font-size: 2rem;
    margin-bottom: 4px;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(255, 107, 53, 0.3));
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.header h1 {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.header p {
    color: var(--text-medium);
    font-size: 0.85rem;
    font-weight: 400;
    margin-top: 4px;
}

/* ---- Calculator Card (Glass) ---- */
.calculator-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 12px 18px;
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
}

.calculator-card:hover {
    box-shadow: 0 12px 48px rgba(255, 107, 53, 0.12);
}

.calculator-card.reset-flash {
    animation: resetPulse 0.6s ease;
}

@keyframes resetPulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.98); box-shadow: 0 4px 16px var(--primary-glow); }
    100% { transform: scale(1); }
}

/* ---- Step Groups ---- */
.step-group {
    margin-bottom: 8px;
    position: relative;
}

.step-group:last-of-type {
    margin-bottom: 0;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.step-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-subtle);
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    transition: var(--transition);
    flex-shrink: 0;
}

.step-indicator.completed {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    box-shadow: 0 2px 8px var(--primary-glow);
    transform: scale(1.1);
}

.step-indicator.completed::after {
    content: '✓';
    font-size: 0.9rem;
}

.step-indicator.completed span {
    display: none;
}

.step-label h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.2;
}

.step-label p {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 400;
}

/* ---- Form Elements ---- */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '▾';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1rem;
    pointer-events: none;
}

/* Custom select has its own arrow — suppress the wrapper's ::after */
.select-wrapper:has(.custom-select)::after {
    display: none;
}

select, input[type="number"] {
    width: 100%;
    padding: 9px 14px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.8);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}

select {
    padding-right: 40px;
    cursor: pointer;
}

select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---- Custom Transport Dropdown ---- */
.custom-select {
    width: 100%;
    position: relative;
    user-select: none;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.8);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
    min-height: 52px;
}

.custom-select[data-disabled="true"] .custom-select-trigger {
    opacity: 0.5;
    cursor: not-allowed;
}

.custom-select:not([data-disabled="true"]) .custom-select-trigger:hover {
    border-color: var(--primary-light);
}

.custom-select.open .custom-select-trigger {
    border-color: var(--primary);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-select-value {
    flex: 1;
    padding: 2px 6px;
    border-radius: 4px;
}

.custom-select-arrow {
    color: var(--primary);
    font-size: 1rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.custom-select.open .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border: 2px solid var(--primary);
    border-top: none;
    border-bottom-left-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
    background: #fff;
    z-index: 100;
    max-height: none;
    overflow-y: visible;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.custom-select.open .custom-select-dropdown {
    display: block;
}

.custom-option {
    padding: 12px 18px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: filter 0.15s;
}

.custom-option:hover {
    filter: brightness(0.92);
}

.custom-option.selected {
    font-weight: 600;
}

.custom-option-placeholder {
    color: #888;
}

select:hover:not(:disabled),
input[type="number"]:hover {
    border-color: var(--primary-light);
}

select:focus,
input[type="number"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: var(--white);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* ---- Input with suffix (Km / Fahrt) ---- */
.input-suffix-wrap {
    position: relative;
    width: 100%;
}
.input-suffix-wrap input[type="number"] {
    padding-right: 52px;
}
.input-suffix {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-dark);
    pointer-events: none;
    user-select: none;
}

/* ---- ACTK Info Badge ---- */
.actk-info {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    padding: 10px 16px;
    background: var(--primary-subtle);
    border-radius: var(--radius-xs);
    border-left: 3px solid var(--primary);
    font-size: 0.85rem;
    opacity: 0;
    transform: translateY(-8px);
    transition: var(--transition);
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    padding: 0 16px;
    margin-top: 0;
}

.actk-info.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    max-height: 60px;
    padding: 10px 16px;
    margin-top: 10px;
}

.actk-info .info-label {
    color: var(--text-light);
    font-weight: 500;
}

.actk-info .info-value {
    color: var(--primary);
    font-weight: 700;
}

/* ---- ACTK Info in Result Card ---- */
.result-actk-info {
    margin-top: 6px;
    padding: 8px 14px;
    background: var(--primary-subtle);
    border-radius: var(--radius-xs);
    border-left: 3px solid var(--primary);
    font-size: 0.85rem;
    color: var(--text-dark);
}

.result-actk-info .info-label {
    color: var(--text-light);
    font-weight: 500;
}

.result-actk-info .info-value {
    color: var(--primary);
    font-weight: 700;
}

/* ---- Buttons ---- */
.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    align-items: stretch;
}

.btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.93rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
}

/* Zeitraum period selector */
.zeitraum-wrapper {
    flex: 1.5;
    display: flex;
    align-items: stretch;
}

.zeitraum-select-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: stretch;
}

.zeitraum-select {
    width: 100%;
    padding: 15px 34px 15px 12px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.8);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    color: var(--text-dark);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: var(--transition);
    outline: none;
    line-height: 1.3;
}

.zeitraum-select:disabled { opacity: 0.5; cursor: not-allowed; }
.zeitraum-select:hover { border-color: var(--primary-light); }
.zeitraum-select:focus  { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-glow); background: var(--white); }

.zeitraum-arrow {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--primary);
    font-size: 1rem;
}

.zeitraum-wrapper.status-past    .zeitraum-select { border-color: #daa520; border-left: 4px solid #daa520; }
.zeitraum-wrapper.status-current .zeitraum-select { border-color: #27ae60; border-left: 4px solid #27ae60; }
.zeitraum-wrapper.status-future  .zeitraum-select { border-color: #c0392b; border-left: 4px solid #c0392b; }

/* Slightly narrower Zurücksetzen */
.btn-reset { flex: 0.75 !important; }

/* ACTK info status colors */
.actk-info.status-past    { border-left-color: #daa520; background: rgba(218,165,32,0.08); }
.actk-info.status-current { border-left-color: #27ae60; background: rgba(39,174,96,0.08); }
.actk-info.status-future  { border-left-color: #c0392b; background: rgba(192,57,43,0.08); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-medium);
    border: 2px solid var(--border-light);
    flex: 1;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-subtle);
}

/* ---- Error Box ---- */
.error-box {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: var(--radius-xs);
    padding: 12px 18px;
    color: var(--error);
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 16px;
    opacity: 0;
    transform: translateY(-8px);
    transition: var(--transition);
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    padding: 0 18px;
}

.error-box.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    max-height: 60px;
    padding: 12px 18px;
    margin-top: 16px;
}

/* ---- Result Card ---- */
.result-card {
    margin-top: 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    max-height: 0;
}

.result-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    max-height: 600px;
    padding: 0;
    margin-top: 24px;
}

.result-header {
    padding: 18px 24px 4px;
    color: var(--text-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-header .print-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: var(--white);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-header .print-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.result-body {
    padding: 10px 18px 14px;
}

/* ---- Result Summary ---- */
.result-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--primary-subtle);
    border-radius: var(--radius-xs);
    margin-bottom: 14px;
    font-size: 0.85rem;
}

.result-summary .summary-insurance {
    font-weight: 700;
    color: var(--text-dark);
}

.result-summary .summary-sep {
    color: var(--primary);
    font-weight: 700;
}

.result-summary .summary-detail {
    color: var(--text-medium);
    font-weight: 500;
}

/* ---- PDF-style Line Items ---- */
.result-line {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 107, 53, 0.08);
    font-size: 0.92rem;
    gap: 12px;
}

.result-line:last-child {
    border-bottom: none;
}

.result-line .line-code {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-subtle);
    padding: 4px 8px;
    border-radius: 6px;
    min-width: 90px;
    text-align: center;
    white-space: nowrap;
}

.result-line .line-desc {
    flex: 1;
    color: var(--text-medium);
    font-weight: 500;
}

.result-line .line-price {
    font-weight: 700;
    color: var(--text-dark);
    text-align: right;
    white-space: nowrap;
}

/* ---- Total Line ---- */
.result-line.total {
    margin-top: 6px;
    padding-top: 14px;
    border-top: 2px solid var(--primary);
    border-bottom: none;
}

.result-line.total .line-desc {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.05rem;
}

.result-line.total .line-price {
    color: var(--primary);
    font-weight: 800;
    font-size: 1.3rem;
}

/* ---- Footer ---- */
.footer {
    text-align: center;
    margin-top: 32px;
    padding: 16px;
    color: var(--text-light);
    font-size: 0.8rem;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    text-decoration: underline;
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
    .results-row {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 16px 12px 32px;
    }

    .header h1 {
        font-size: 1.6rem;
    }

    .calculator-card {
        padding: 24px 18px;
        border-radius: 16px;
    }

    .btn-row {
        flex-direction: column;
    }

    .btn-secondary {
        flex: 1;
    }

    .zeitraum-wrapper { flex: 1 !important; width: 100%; }
    .btn-reset        { flex: 1 !important; }

    .actk-info {
        flex-direction: column;
        gap: 4px;
    }

    .result-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    body::before {
        width: 300px;
        height: 300px;
    }

    body::after {
        width: 250px;
        height: 250px;
    }
}

/* ---- Results Row (side-by-side layout) ---- */
.results-row {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    align-items: flex-start;
}

.results-row .billing-card,
.results-row .result-card {
    flex: 1;
    margin-top: 0;
}

/* ---- Billing Form Card ---- */
.billing-card {
    margin-top: 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.97);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s;
    pointer-events: none;
    max-height: 0;
}

.billing-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    max-height: 420px;
}

.billing-header {
    padding: 14px 24px 4px;
    color: var(--text-dark);
}

.billing-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.billing-body {
    padding: 14px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ---- Billing Form Rows ---- */
.bf-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: nowrap;
    width: 100%;
}

.bf-row--pos {
    gap: 24px;
    border-top: 1px solid var(--border-light);
    padding-top: 14px;
}

/* ---- Billing Form Fields ---- */
.bf-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.bf-field--grow {
    flex: 1 1 auto;
    min-width: 0;
}

.bf-field--push {
    margin-left: auto;
}

.bf-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* ---- Individual Boxes ---- */
.bf-boxes {
    display: flex;
}

.billing-box {
    width: 16px;
    height: 27px;
    border: 1.5px solid rgba(74, 74, 106, 0.3);
    border-right: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-dark);
    background: rgba(255, 255, 255, 0.55);
    line-height: 1;
    transition: background 0.2s, color 0.2s;
}

.billing-box:last-child {
    border-right: 1.5px solid rgba(74, 74, 106, 0.3);
}

.billing-box.filled {
    color: var(--primary);
    background: var(--primary-subtle);
    border-color: rgba(255, 107, 53, 0.35);
}

.billing-box.filled + .billing-box:not(.filled) {
    border-left-color: rgba(74, 74, 106, 0.3);
}

/* ---- Amount Fields (with comma) ---- */
.bf-amount {
    display: flex;
    align-items: flex-end;
}

.bf-comma {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 27px;
    padding: 0 2px;
}

/* ---- Position Groups ---- */
.bf-pos-group {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex: 1;
    justify-content: space-between;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .billing-body {
        padding: 14px 16px 16px;
        gap: 14px;
    }

    .bf-row {
        flex-wrap: wrap;
        gap: 12px;
    }

    .bf-field--push {
        margin-left: 0;
    }

    .bf-row--pos {
        gap: 16px;
        flex-direction: column;
    }

    .billing-box {
        width: 14px;
        height: 23px;
        font-size: 0.68rem;
    }
}

/* ---- Print Styles ---- */
@media print {
    body::before,
    body::after {
        display: none;
    }
    
    .header-top,
    .btn-row,
    .footer,
    .print-btn {
        display: none !important;
    }

    .calculator-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .result-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ---- Step Connector Lines ---- */
.step-group::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 44px;
    bottom: -12px;
    width: 2px;
    background: var(--border-light);
}

.step-group:last-of-type::before {
    display: none;
}

/* ---- Loading Shimmer ---- */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.loading select {
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.8) 25%, 
        rgba(255,107,53,0.05) 50%, 
        rgba(255,255,255,0.8) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ---- Login Overlay ---- */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 28px;
    overflow: hidden;
    box-shadow:
        0 20px 60px rgba(255, 107, 53, 0.18),
        0 4px 20px rgba(0,0,0,0.08);
    animation: loginFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes loginFadeIn {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Hero section - orange gradient top */
.login-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 40px 40px 36px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-hero::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    top: -60px;
    right: -40px;
}

.login-hero::after {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    bottom: -30px;
    left: -20px;
}

.login-ambulance {
    font-size: 3.2rem;
    display: block;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
    position: relative;
    z-index: 1;
}

.login-title {
    font-size: 1.7rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 2px;
    position: relative;
    z-index: 1;
}

.login-brand {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.75);
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

/* Form body - white */
.login-body {
    background: #fff;
    padding: 36px 40px 40px;
}

.login-subtitle {
    font-size: 0.95rem;
    color: var(--text-medium);
    margin-bottom: 24px;
    font-weight: 500;
}

.login-error {
    background: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.2);
    color: var(--error);
    border-radius: var(--radius-xs);
    font-size: 0.87rem;
    max-height: 0;
    padding: 0 14px;
    overflow: hidden;
    transition: var(--transition);
    margin-bottom: 0;
}

.login-error.visible {
    padding: 10px 14px;
    max-height: 60px;
    margin-bottom: 18px;
}

#loginForm {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-medium);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.login-field input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #E8E8F0;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    background: #FAFAFA;
    color: var(--text-dark);
    outline: none;
    transition: var(--transition);
}

.login-field input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    margin-top: 6px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.35);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.45);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* OTP step extras */
.otp-subtitle {
    text-align: center;
    line-height: 1.5;
}

.otp-resend,
.otp-back {
    text-align: center;
    font-size: 0.83rem;
    margin-top: 12px;
    color: var(--text-medium);
}

.otp-resend a,
.otp-back a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.otp-resend a:hover,
.otp-back a:hover {
    text-decoration: underline;
}

/* Logout button in footer */
.logout-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 8px;
    text-decoration: underline;
    font-family: inherit;
}

.logout-btn:hover {
    color: var(--primary);
}

/* ---- Divider ---- */
.step-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-light), transparent);
    margin: 4px 0;
}

/* ---- Side-by-side Steps Row ---- */
.step-row {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.step-row .step-group {
    flex: 1;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.step-row .step-group .input-suffix-wrap {
    margin-top: auto;
}

.step-row .step-group::before {
    display: none;
}

@media (max-width: 640px) {
    .step-row {
        flex-direction: column;
        gap: 0;
    }

    .step-row .step-group {
        margin-bottom: 24px;
    }

    .step-row .step-group:last-child {
        margin-bottom: 0;
    }
}
