/* ==================== CSS VARIABLES ==================== */
:root {
    --primary: #009E9C;
    --primary-dark: #007C7A;
    --primary-light: #E0F7F6;
    --success: #059669;
    --success-dark: #047857;
    --success-light: #D1FAE5;
    --error: #DC2626;
    --error-light: #FEE2E2;
    --warning: #F59E0B;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --white: #FFFFFF;
    
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Dynamic viewport height for mobile */
    --vh: 1vh;
}

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

html {
    height: 100%;
    height: -webkit-fill-available;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.mi {
    font-family: 'Material Symbols Rounded';
    font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
}

.mi-14 { font-size: 14px; }
.mi-16 { font-size: 16px; }
.mi-18 { font-size: 18px; }
.mi-20 { font-size: 20px; }
.mi-24 { font-size: 24px; }
.mi-32 { font-size: 32px; }
.mi-36 { font-size: 36px; }
.mi-40 { font-size: 40px; }
.mi-48 { font-size: 48px; }

/* ==================== STATE CONTAINERS ==================== */
.state {
    display: none;
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    padding: 16px;
}

.state.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease-out;
}

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

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== LOADING STATE ==================== */
#state-loading {
    background: var(--gray-100);
}

.loading-content {
    text-align: center;
    color: var(--gray-700);
}

.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

.loading-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.loading-content p {
    font-size: 14px;
    opacity: 0.8;
}

/* ==================== ERROR STATE ==================== */
#state-error {
    background: var(--gray-100);
}

.error-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-xl);
}

.error-icon {
    width: 72px;
    height: 72px;
    background: var(--error-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.error-icon .mi {
    color: var(--error);
}

.error-card h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.error-card p {
    font-size: 15px;
    color: var(--gray-500);
    margin-bottom: 24px;
}

.error-hint {
    font-size: 14px;
    color: var(--gray-400);
    margin-top: -16px;
}

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

/* ==================== MODAL STATE ==================== */
#state-modal {
    background: var(--gray-100);
    padding: 16px;
}

.modal-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    max-width: 480px;
    width: 100%;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.5s ease-out;
}

.modal-header {
    background: var(--white);
    /* padding: 24px 24px; */
    text-align: center;
    color: var(--gray-900);
}

.modal-brand {
    display: block;
    width: 100%;
    margin: 0;
}

.modal-brand-logo {
    width: 100%;
    height: auto;
    display: block;
}

.modal-brand-text {
    text-align: left;
    line-height: 1.1;
}

.modal-brand-title {
    display: block;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.modal-brand-subtitle {
    display: block;
    font-size: 12px;
    font-weight: 500;
    opacity: 0.9;
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-header p {
    font-size: 14px;
    opacity: 0.9;
}

.modal-body {
    padding: 24px;
    padding-top: 0;
}

.modal-consent-intro {
    text-align: center;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #00B5B2 0%, #008483 100%);
    border-radius: 16px;
    padding: 32px 14px;
}

.modal-consent-intro h2 {
    font-size: 28px;
    line-height: 1.05;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 10px;
}

.modal-consent-intro p {
    font-size: 16px;
    line-height: 1.2;
    color: var(--white);
    font-weight: 500;
}

/* ============================================================
   CHECKBOX ITEMS - KOMPLETT KLICKBAR
   ============================================================ */
.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
    user-select: none;
}

.checkbox-item:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.checkbox-item.checked {
    border-color: #10b981;
    background: #ecfdf5;
}

.checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-wrapper {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid #cbd5e1;
    transition: all 0.2s ease;
}

.checkbox-wrapper .mi {
    color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.checkbox-item.checked .checkbox-wrapper .mi {
    opacity: 1;
}

.checkbox-item.checked .checkbox-wrapper {
    background: #10b981;
    border-color: #10b981;
}

.checkbox-label {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
}

.checkbox-label a {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 500;
}

.checkbox-label a:hover {
    color: #1d4ed8;
}

.checkbox-label strong {
    color: #0f172a;
}

/* ============================================================
   CHECKBOX EMERGENCY (GELBER RAND)
   ============================================================ */
.checkbox-emergency {
    border-color: #fbbf24;
    background: #fffbeb;
}

.checkbox-emergency:hover {
    border-color: #f59e0b;
    background: #fef3c7;
}

.checkbox-emergency.checked {
    border-color: #10b981;
    background: #ecfdf5;
}

.modal-footer {
    padding: 0 24px 24px;
}

.modal-legal-footer {
    padding: 16px 24px;
    background: var(--gray-50);
    text-align: center;
    font-size: 13px;
    border-top: 1px solid var(--gray-200);
}

.modal-legal-footer a {
    color: var(--gray-500);
    text-decoration: none;
}

.modal-legal-footer a:hover {
    color: var(--primary);
}

.modal-legal-footer .divider {
    color: var(--gray-300);
    margin: 0 8px;
}

/* ==================== SIGNING STATE ==================== */
#state-signing {
    background: var(--gray-100);
    padding: 0;
    justify-content: flex-start;
    align-items: stretch;
    min-height: calc(var(--vh, 1vh) * 100);
}

.document-container {
    width: 100%;
    max-width: 640px;
    background: var(--white);
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

/* Top Bar */
.doc-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-logo {
    height: 28px;
    object-fit: contain;
}

.topbar-step {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 6px 12px;
    border-radius: 20px;
}

.doc-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 24px 20px;
    color: var(--white);
}

.doc-header-top {
    margin-bottom: 16px;
    gap: 8px;
}

.doc-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* ============================================================
   KOSTENLOS BADGE
   ============================================================ */
.doc-badge-free {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 600;
}

.doc-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.doc-header p {
    font-size: 14px;
    opacity: 0.9;
}

.doc-content {
    flex: 1;
    padding: 20px;
}

.doc-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title .mi {
    color: var(--gray-400);
}

.data-grid {
    display: grid;
    gap: 12px;
}

.data-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.data-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.data-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
}

.address-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.address-line {
    line-height: 1.5;
}

.address-delivery {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--gray-200);
}

.address-delivery-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

/* ============================================================
   PRODUCT CARDS
   ============================================================ */
.product-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #86efac;
    border-radius: 16px;
    margin-bottom: 12px;
}

.product-card-addon {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
}

.product-card-emergency {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fdba74;
}

.product-card-bed {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
}

/* ============================================================
   PRODUCT CARD YEARLY (PG 51)
   ============================================================ */
.product-card-yearly {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #fbbf24;
}

.product-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.product-icon .mi {
    color: #059669;
}

.product-icon-emergency .mi {
    color: #ea580c;
}

.product-icon-addon .mi {
    color: #2563eb;
}

.product-icon-bed .mi {
    color: #2563eb;
}

.product-icon-yearly {
    background: #f59e0b;
}

.product-icon-yearly .mi {
    color: white;
}

.product-info {
    flex: 1;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.product-header h4 {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
}

.product-price {
    font-size: 14px;
    font-weight: 700;
    color: #059669;
    white-space: nowrap;
}

.product-subtitle {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #64748b;
}

.product-subtitle-checks {
    display: grid;
    gap: 6px;
    margin: 0 0 12px 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: #64748b;
}

.product-subtitle-checks li {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.product-subtitle-checks li::before {
    content: "✓";
    color: #10b981;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 1px;
}

.product-fee-notice {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 10px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.5;
    color: #9a3412;
}

.product-fee-notice .mi {
    flex-shrink: 0;
    color: #ea580c;
    margin-top: 1px;
}

.product-contents {
    margin: 0;
    padding: 0;
    list-style: none;
}

.product-contents li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #475569;
    padding: 4px 0;
}

.content-icon {
    font-size: 14px;
}

.product-badge-yearly {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    background: #f59e0b;
    color: white;
}

/* ============================================================
   WARNING: NO PRODUCT
   ============================================================ */
.no-product-warning {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 12px;
    color: #991b1b;
    font-size: 14px;
}

.no-product-warning .mi {
    flex-shrink: 0;
}

/* ============================================================
   SERVICE BANNER (für Kündigungs-Service später)
   ============================================================ */
.service-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
    border-radius: 12px;
    margin-top: 12px;
}

.service-banner-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #f59e0b;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-banner-icon .mi {
    color: white;
}

.service-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.service-banner-text strong {
    font-size: 14px;
    color: #92400e;
}

.service-banner-text span {
    font-size: 12px;
    color: #a16207;
}

/* ============================================================
   BADGE FREE (für Checkbox)
   ============================================================ */
.badge-free {
    display: inline-block;
    background: #10b981;
    color: white;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 6px;
}

/* ============================================================
   SPINNER SMALL
   ============================================================ */
.spinner-small {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}



/* ==================== SIGNATURE SECTION ==================== */
.signature-section {
    background: var(--gray-50);
    padding: 20px;
    border-top: 1px solid var(--gray-200);
}

.signature-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.signature-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 8px;
}

.signature-label .mi {
    color: var(--primary);
}

.signature-box {
    background: var(--white);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.signature-box.active {
    border-color: var(--primary);
    border-style: solid;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.signature-box canvas {
    width: 100%;
    height: 160px;
    display: block;
    touch-action: none;
    cursor: crosshair;
}

.signature-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--gray-400);
    pointer-events: none;
    transition: opacity 0.3s ease;
    text-align: center;
}

.signature-hint.hidden {
    opacity: 0;
}

.signature-hint .mi {
    color: var(--gray-400);
    font-size: 44px;
}

.signature-hint .signature-hint-text {
    font-size: 13px;
    font-weight: 500;
}

.signature-hint-text-mobile {
    display: none;
}

.signature-hint-text-desktop {
    display: inline;
}

.signature-hint-icon-mobile {
    display: none;
}

.signature-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.signature-clear .mi {
    color: currentColor;
}

.signature-clear:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.signature-actions {
    display: flex;
    gap: 12px;
    margin: 16px 0 24px;
    padding: 0 8px;
}

.btn-clear {
    flex: 0 0 auto;
    background: var(--white);
    border: 2px solid var(--gray-200);
    color: var(--gray-600);
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.btn-clear:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.btn-clear .mi {
    color: currentColor;
}

.btn-clear-text {
    display: none;
}

/* ==================== LEGAL FOOTER ==================== */
.legal-footer {
    padding: 20px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.legal-footer p {
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.6;
    margin-bottom: 12px;
}

.legal-links {
    font-size: 12px;
}

.legal-links a {
    color: var(--gray-500);
    text-decoration: none;
}

.legal-links a:hover {
    color: var(--primary);
}

.legal-links .divider {
    color: var(--gray-300);
    margin: 0 6px;
}

/* ==================== FULLSCREEN SIGNATURE (Mobile) ==================== */
#state-signature-fullscreen {
    padding: 0;
    background: var(--white);
    min-height: calc(var(--vh, 1vh) * 100);
}

#state-signature-fullscreen.state.active {
    justify-content: flex-start;
    align-items: stretch;
}

.fullscreen-signature {
    width: 100%;
    height: 100%;
    min-height: calc(var(--vh, 1vh) * 100);
    display: flex;
    flex-direction: column;
    background: var(--white);
}

.fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--gray-900);
    color: var(--white);
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--white);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    margin: -8px -12px;
    font-family: inherit;
}

.btn-back .mi {
    color: var(--white);
}

.fullscreen-title {
    font-size: 16px;
    font-weight: 600;
}

.btn-clear-fullscreen {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.btn-clear-fullscreen .mi {
    color: currentColor;
}

.btn-clear-fullscreen:hover {
    background: var(--gray-50);
}

.fullscreen-canvas-wrapper {
    flex: 1;
    min-height: 0;
    position: relative;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
}

.fullscreen-canvas-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
}

.signature-hint-fullscreen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--gray-400);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.signature-hint-fullscreen.hidden {
    opacity: 0;
}

.signature-hint-fullscreen .mi {
    color: var(--gray-400);
}

.signature-hint-fullscreen .signature-hint-text {
    font-size: 16px;
    font-weight: 500;
}

.fullscreen-footer {
    padding: 16px;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
}

.fullscreen-submit {
    width: 100%;
}

/* ==================== SUCCESS STATE ==================== */
#state-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
}

.success-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 40px 28px;
    text-align: center;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-xl);
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: successPop 0.5s ease-out;
}

.success-icon .mi {
    color: var(--success);
}

.success-card h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.success-card > p {
    font-size: 15px;
    color: var(--gray-500);
}

.success-card .highlight {
    color: var(--success);
    font-weight: 600;
}

.success-info {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 24px;
    text-align: left;
}

.success-service-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #ecfdf5;
    border-radius: 12px;
    margin-top: 16px;
}

.success-service-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #10b981;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-service-icon .mi {
    color: white;
}

.success-service-info p {
    margin: 0;
    font-size: 14px;
    color: #065f46;
}

.success-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.success-info ul {
    list-style: none;
}

.success-info li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--gray-600);
}

.success-info li .mi {
    color: var(--success);
    flex-shrink: 0;
}

.success-contact {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.success-contact p {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.btn-phone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
}

.btn-phone .mi {
    color: var(--primary);
}

.success-footer-links {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
}

.success-footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
}

.success-footer-links a:hover {
    color: var(--white);
}

.success-footer-links .divider {
    color: rgba(255,255,255,0.4);
    margin: 0 8px;
}

/* ==================== BUTTONS ==================== */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    padding: 16px 24px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 14px 0 rgba(0,102,204,0.39);
    font-family: inherit;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(0,102,204,0.5);
}

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

.btn-primary:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-primary .mi {
    color: var(--white);
}

.btn-success {
    flex: 1;
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    color: var(--white);
    border: none;
    padding: 16px 0;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px 0 rgba(5,150,105,0.39);
    font-family: inherit;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(5,150,105,0.5);
}

.btn-success:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-success .mi {
    color: var(--white);
}

/* ==================== DESKTOP STYLES ==================== */
@media (min-width: 768px) {
    #state-signing {
        padding: 32px 16px;
        justify-content: center;
    }
    
    .document-container {
        min-height: auto;
        border-radius: var(--radius-xl);
        margin: 0 auto;
        overflow: hidden;
    }
    
    .doc-topbar {
        position: relative;
    }
    
    .topbar-logo {
        height: 32px;
    }
    
    .doc-header {
        padding: 32px;
    }
    
    .doc-header h1 {
        font-size: 26px;
    }
    
    .doc-content {
        padding: 32px;
    }
    
    .data-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    
    .data-item.full-width {
        grid-column: 1 / -1;
    }
    
    .signature-section {
        padding: 32px;
    }
    
    .signature-box canvas {
        height: 240px;
    }
    
    .btn-clear-text {
        display: inline;
    }
    
    .legal-footer {
        padding: 24px 32px;
    }
    
    /* Hide fullscreen signature on desktop */
    #state-signature-fullscreen {
        display: none !important;
    }
}

/* ==================== MOBILE SPECIFIC ==================== */
@media (max-width: 767px) {
    #state-modal {
        padding: 12px;
    }

    .modal-header {
        padding: 20px 16px;
    }

    .modal-brand-logo {
        width: 100%;
    }

    .modal-body {
        padding: 20px 16px;
    }

    .modal-consent-intro h2 {
        font-size: 28px;
    }

    .modal-consent-intro p {
        font-size: 16px;
    }

    #state-signing {
        background: var(--white);
    }

    .document-container {
        max-width: 100%;
        min-height: calc(var(--vh, 1vh) * 100);
        border-radius: 0;
        box-shadow: none;
    }
    .doc-header {
        padding: 28px 20px;
    }

    .doc-header h1 {
        font-size: 24px;
        line-height: 1.25;
    }

    .doc-header p {
        font-size: 16px;
    }

    .doc-badge {
        font-size: 13px;
        padding: 8px 12px;
    }

    .doc-content {
        padding: 20px;
    }

    .doc-section {
        margin-bottom: 28px;
    }

    .section-title {
        font-size: 12px;
        letter-spacing: 0.4px;
    }

    .data-item {
        padding: 14px;
        gap: 4px;
    }

    .data-label {
        font-size: 12px;
    }

    .data-value {
        font-size: 16px;
        line-height: 1.35;
    }

    .address-delivery-title {
        font-size: 12px;
    }

    .product-card {
        align-items: flex-start;
        padding: 18px;
        gap: 12px;
    }

    .product-contents {
        margin-left: -64px;
        width: calc(100% + 64px);
    }

    .product-icon {
        width: 56px;
        height: 56px;
    }

    .product-icon .mi {
        font-size: 26px;
    }

    .product-header h4 {
        font-size: 17px;
        line-height: 1.3;
    }

    .product-price {
        font-size: 15px;
    }

    .product-subtitle,
    .product-subtitle-checks,
    .product-contents li {
        font-size: 14px;
    }

    .product-subtitle-checks li::before {
        margin-top: 2px;
    }

    .product-fee-notice {
        font-size: 13px;
        padding: 10px 12px;
    }

    .no-product-warning {
        font-size: 15px;
        padding: 18px;
    }

    .signature-section {
        padding: 24px;
    }

    .signature-label {
        font-size: 16px;
    }

    .signature-clear {
        padding: 10px 12px;
        font-size: 13px;
    }

    .signature-box canvas {
        height: 200px;
    }

    .signature-actions {
        flex-direction: column;
        align-items: stretch;
        margin: 18px 0 28px;
    }

    .btn-success {
        width: 100%;
        order: 1;
        font-size: 16px;
        padding: 18px 20px;
        min-height: 52px;
    }

    .btn-primary {
        font-size: 16px;
        padding: 18px 24px;
        min-height: 52px;
    }

    /* Touch auf Signature Box öffnet Fullscreen */
    .signature-box {
        cursor: pointer;
    }
    
    .signature-box canvas {
        pointer-events: none;
    }

    .signature-hint .mi {
        font-size: 48px;
    }

    .signature-hint .signature-hint-text {
        font-size: 16px;
    }

    .signature-hint-text-desktop {
        display: none;
    }

    .signature-hint-text-mobile {
        display: inline;
    }

    .signature-hint-icon-desktop {
        display: none;
    }

    .signature-hint-icon-mobile {
        display: inline-flex;
    }

    .legal-footer p {
        font-size: 14px;
    }

    .legal-links {
        font-size: 14px;
    }

    .fullscreen-header {
        padding: 16px;
    }

    .btn-back {
        font-size: 16px;
        padding: 10px 12px;
        margin: -10px -12px;
    }

    .fullscreen-title {
        font-size: 18px;
    }

    .btn-clear-fullscreen {
        padding: 10px 12px;
        font-size: 13px;
    }

    .signature-hint-fullscreen .mi {
        font-size: 56px;
    }

    .signature-hint-fullscreen .signature-hint-text {
        font-size: 18px;
    }

    .fullscreen-footer {
        padding: 18px;
    }
    /*
    .signature-hint span {
        font-size: 12px;
    }
    
    .signature-hint span::after {
        content: ' (tippen zum Vergrößern)';
    }*/
}

/* ==================== UTILITY ==================== */
.hidden {
    display: none !important;
}
