/* Smart Cancel Feature Styles - Full Version */
.smart-cancel-header-card {
    background: rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.sc-header-left h2 {
    font-size: 1.6rem;
    margin-bottom: 8px;
    text-align: left;
    color: #fff;
    /* Fallback color set to white */
    background: linear-gradient(135deg, #7c4dff, #ff4081);
    /* Explicit gradient */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}


.sc-header-left p {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: left;
    /* Explicitly left align */
}

.sc-stats-mini {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sc-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sc-stat-item i {
    color: var(--accent);
}

.sc-search-wrapper {
    margin-top: 15px;
    margin-bottom: 32px;
}

.sc-search-container {
    position: relative;
    max-width: 100%;
    /* Take full width on mobile or use a larger max-width */
    margin: 0;
    /* Left align */
}

.sc-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
}

.sc-form-group input,
.sc-form-group select {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.2s;
    outline: none;
}

.sc-form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 16L6 10H18L12 16Z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 35px;
}

.sc-form-group input:focus,
.sc-form-group select:focus {
    border-color: var(--accent);
    background: rgba(124, 77, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.2);
}

.sc-form-group input.error,
.sc-form-group select.error,
.sc-address-edit-form input.error {
    border-color: #ff4444 !important;
    background: rgba(255, 68, 68, 0.05) !important;
    box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.2) !important;
}

/* Subtle live validation only after user has interacted */
.sc-form-group input:not(:placeholder-shown):invalid,
.sc-address-edit-form input:not(:placeholder-shown):invalid {
    border-color: #ffbb33;
    background: rgba(255, 187, 51, 0.05);
}

#sc-provider-search {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.2s;
}

#sc-provider-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.2);
    outline: none;
}

.sc-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #110b24 !important;
    /* Extremely solid dark background */
    opacity: 1 !important;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    display: none;
}

body.light-theme .sc-results-dropdown {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.sc-results-dropdown.active {
    display: block;
}

.sc-result-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.sc-result-item:hover {
    background: var(--bg-secondary);
}

body.light-theme .sc-result-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-theme .sc-result-item:hover {
    background: rgba(124, 77, 255, 0.05);
}

.sc-result-name {
    display: block;
    font-weight: 500;
    margin-bottom: 2px;
    color: var(--text-main);
}

body.light-theme .sc-result-name {
    color: #1e293b;
}

.sc-result-cat {
    font-size: 0.75rem;
    color: var(--text-muted);
}

body.light-theme .sc-result-cat {
    color: #64748b;
}

.sc-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.sc-info-card {
    background: rgba(255, 255, 255, 0.03);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    text-align: left !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sc-info-card * {
    text-align: left !important;
}

.sc-info-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.sc-info-card i {
    font-size: 2rem;
    color: var(--primary-color, #7c4dff);
    margin-bottom: 15px;
    display: block;
    background: linear-gradient(135deg, var(--primary-color, #7c4dff), #8e44ad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(124, 77, 255, 0.3));
}

/* Fallback for browsers not supporting text-fill-color */
@supports not (-webkit-text-fill-color: transparent) {
    .sc-info-card i {
        background: none;
        -webkit-text-fill-color: initial;
        color: var(--primary-color, #7c4dff);
    }
}

.sc-info-card h4 {
    margin-bottom: 12px;
    font-weight: 600;
}

.sc-info-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Animations */
@keyframes shake-ui {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

.shake-ui {
    animation: shake-ui 0.4s ease-in-out;
}

.sc-hidden {
    display: none;
}

/* Wizard & Steps */
.sc-wizard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}

.sc-back-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.sc-back-btn:hover {
    color: white;
}

.sc-steps-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sc-step {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    -webkit-user-select: none;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sc-step i {
    font-size: 1.05rem;
    opacity: 0.8;
}

.sc-step-divider {
    color: var(--text-muted);
    font-size: 1.1rem;
    opacity: 0.5;
}

.sc-step:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sc-step.active {
    color: white;
    background: var(--accent);
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.4);
}

.sc-step.active:hover {
    background: linear-gradient(135deg, #8c6fff 0%, #ab47bc 100%);
    box-shadow: 0 6px 20px rgba(124, 77, 255, 0.5);
}

/* Wizard Content */
.sc-wizard-pane {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.sc-wizard-pane.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Provider Detail Card */
.sc-provider-card,
.sc-signature-card,
.sc-preview-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--card-shadow);
}

#sc-provider-info {
    margin-bottom: 24px;
}

#sc-provider-info strong {
    font-size: 1.4rem;
    display: block;
    margin-bottom: 8px;
}

#sc-provider-info span {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    display: block;
}

.sc-form-section h4,
.sc-signature-card h4,
.sc-preview-card h4 {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--accent);
}

.sc-span-2 {
    grid-column: span 2;
}

.sc-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.sc-form-group-row {
    display: flex;
    gap: 15px;
}

.sc-form-group.group-main {
    flex: 1;
}

.sc-form-group.group-side {
    flex: 0 0 100px;
}

.sc-form-group.group-side input {
    text-align: center;
}

.sc-dynamic-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.sc-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sc-form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.sc-form-group input {
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    transition: border-color 0.2s;
}

.sc-form-group input:focus {
    border-color: var(--accent);
}

/* Signature Pad */
.sc-signature-wrapper {
    background: white;
    border-radius: 12px;
    position: relative;
    margin-bottom: 20px;
    height: 250px;
}

#sc-signature-pad {
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.sc-clear-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    font-size: 0.75rem;
    color: #666;
    cursor: pointer;
}

.sc-sign-note {
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

/* Letter Preview */
/* Delivery Options */
.sc-delivery-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sc-preview-row {
    margin-top: 15px;
}

.sc-delivery-option {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 20px !important;
    /* Force better spacing as requested */
}

.sc-delivery-option label {
    display: block;
    padding: 12px 16px;
    cursor: pointer;
    margin-bottom: 0;
    color: var(--text-main);
}

.sc-delivery-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.sc-delivery-option:has(input:checked) {
    border-color: var(--accent);
    background: rgba(124, 77, 255, 0.1);
}

.sc-delivery-option:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.sc-letter-paper {
    background: white;
    color: #333;
    padding: 30px;
    min-height: 400px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 11pt;
    line-height: 1.5;
    margin-bottom: 24px;
}

#sc-letter-signature-img img {
    max-width: 220px;
    max-height: 90px;
    margin-top: 15px;
    /* Removed border-bottom as requested */
}

.sc-action-row {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.btn-glow {
    box-shadow: 0 0 20px rgba(124, 77, 255, 0.4);
}

@media (max-width: 768px) {
    .sc-dynamic-form {
        grid-template-columns: 1fr;
    }

    /* Force all form groups to span full width on mobile */
    .sc-form-group {
        grid-column: span 1 !important;
    }


    .sc-letter-paper {
        padding: 20px;
    }

    .smart-cancel-header-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
        /* Reduce padding to give more room */
    }

    .sc-header-left,
    .sc-header-right {
        width: 100%;
        text-align: left;
    }

    .sc-wizard-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .sc-steps-indicator {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 6px;
        gap: 4px;
        /* Custom scrollbar for steps on mobile */
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    }

    .sc-steps-indicator::-webkit-scrollbar {
        height: 4px;
    }
    
    .sc-steps-indicator::-webkit-scrollbar-track {
        background: transparent;
    }

    .sc-steps-indicator::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 4px;
    }

    .sc-step {
        padding: 6px 10px;
        font-size: 0.75rem;
        white-space: nowrap;
        flex-shrink: 0;
        gap: 4px;
    }

    .sc-step i {
        font-size: 1rem;
    }

    .sc-step-divider {
        font-size: 1rem;
    }
}

/* ===== Provider Info Card Styles ===== */
.sc-provider-header {
    margin-bottom: 12px;
}

.sc-provider-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-main);
    line-height: 1.3;
}

.sc-provider-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sc-category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(124, 77, 255, 0.15);
    color: var(--accent);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sc-address-inline-editor {
    position: relative;
    margin-bottom: 20px;
}

.sc-address-inline-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.sc-address-inline-row i {
    color: var(--accent);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sc-inline-input {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    border-radius: 6px;
    font-size: 0.95rem;
    padding: 6px 10px;
    width: 100%;
    transition: all 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.sc-inline-input:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.02);
}

.sc-inline-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(124, 77, 255, 0.05);
    border-style: solid;
}

.sc-inline-input::placeholder {
    color: rgba(255,255,255,0.25);
}

/* ===== Contact Section Styles ===== */
.sc-contact-section {
    margin-top: 4px;
}

.sc-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
    opacity: 0.7;
}

.sc-contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.sc-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.sc-contact-item:hover {
    background: rgba(124, 77, 255, 0.08);
    border-color: var(--accent);
}

.sc-contact-item i {
    color: var(--accent);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sc-contact-item a {
    color: var(--text-main);
    text-decoration: none;
    word-break: break-word;
    transition: color 0.2s;
}

.sc-contact-item a:hover {
    color: var(--accent);
}

.sc-contact-item span {
    color: var(--text-muted);
    word-break: break-word;
}

@media (max-width: 768px) {
    .sc-contact-grid {
        grid-template-columns: 1fr;
    }

    .sc-provider-name {
        font-size: 1.2rem;
    }
}

/* ===== Smart Cancel Button Styles ===== */
.sc-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    gap: 16px;
}

.sc-action-row .btn-primary,
.sc-action-row .btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-decoration: none;
}

.sc-action-row .btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #9c27b0 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.4);
}

.sc-action-row .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 77, 255, 0.5);
    background: linear-gradient(135deg, #8c6fff 0%, #ab47bc 100%);
}

.sc-action-row .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(124, 77, 255, 0.3);
}

.sc-action-row .btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.sc-action-row .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.sc-action-row .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.sc-action-row .btn-ghost:hover {
    color: var(--text-main);
    border-color: var(--accent);
    background: rgba(124, 77, 255, 0.1);
}

.sc-action-row .btn-ghost i,
.sc-action-row .btn-primary i {
    font-size: 1.1rem;
}

/* Clear Button (in signature area) */
.sc-clear-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.sc-clear-btn:hover {
    background: rgba(255, 82, 82, 0.15);
    border-color: rgba(255, 82, 82, 0.4);
    color: #ff5252;
}

/* Signature wrapper needs relative positioning */
.sc-signature-wrapper {
    position: relative;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .sc-action-row {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .sc-action-row .btn-primary,
    .sc-action-row .btn-ghost {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }
}

/* ===== Success/Completion View Styles ===== */
.sc-success-view {
    text-align: center;
    padding: 30px 10px;
}

.sc-success-icon {
    font-size: 5rem;
    color: #22c55e;
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 10px rgba(34, 197, 94, 0.3));
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.sc-success-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
}

.sc-success-desc {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 32px;
}

.sc-receipt-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    text-align: left;
    max-width: 480px;
    margin: 0 auto;
}

.sc-receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    gap: 16px;
}

.sc-receipt-row:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sc-receipt-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.sc-receipt-value {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
    word-break: break-all;
    text-align: right;
}

.sc-hash-text {
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    opacity: 0.8;
}

.sc-status-badge {
    background: rgba(124, 77, 255, 0.2);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

@media (max-width: 500px) {
    .sc-receipt-row {
        flex-direction: column;
        gap: 4px;
    }

    .sc-receipt-value {
        text-align: left;
    }
}

/* Validation Styles */
.sc-form-group input.error,
.sc-address-edit-form input.error {
    border-color: #ff5252 !important;
    box-shadow: 0 0 0 3px rgba(255, 82, 82, 0.2) !important;
    background: rgba(255, 82, 82, 0.05) !important;
}

.sc-signature-wrapper.error {
    border: 2px solid #ff5252 !important;
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

.shake-ui {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Tooltip Styles */
.sc-tooltip-icon {
    position: relative;
    cursor: help;
    color: var(--text-muted, #888);
    margin-left: 5px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.sc-tooltip-icon:hover {
    color: var(--accent, #8b5cf6);
}

.sc-tooltip-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: pre-wrap;
    width: max-content;
    max-width: 250px;
    z-index: 100;
    pointer-events: none;
    margin-bottom: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

@media (max-width: 768px) {
    .sc-tooltip-icon:hover::after {
        left: auto;
        right: -10px;
        transform: none;
        width: 200px;
        white-space: normal;
        text-align: left;
    }
}

/* Guarantee Badge Mini */
.sc-guarantee-badge-mini {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 12px 15px;
    margin-bottom: 20px;
}

.text-accent {
    color: var(--accent) !important;
}

/* End Edit Address Styles */

@media (max-width: 768px) {

    /* Prevent content from starting under the sticky mobile header */
    #view-smart_cancel {
        padding-top: 50px !important;
    }

    #sc-selection-view {
        padding-top: 10px;
    }

    .sc-wizard-controls {
        gap: 4px;
        /* Reduced gap further */
        padding-bottom: 12px;
        margin-bottom: 16px;
        justify-content: flex-start;
        /* Ensure everything starts from the left */
    }

    .sc-back-btn span {
        display: none;
        /* Hide text on mobile to save space */
    }

    .sc-back-btn i {
        font-size: 1.2rem;
    }

    .sc-steps-indicator {
        gap: 4px;
        /* Tighten gap even more */
        flex: 1;
        justify-content: flex-start;
        /* Shifted from flex-end to left as requested */
        margin-left: 0;
        /* Removed margin to shift further left */
    }

    .sc-step {
        font-size: 0.72rem;
        padding: 4px 12px;
        white-space: nowrap;
        flex-shrink: 0;
        /* Don't shrink labels if possible */
        max-width: none;
        /* Allow more width */
    }

    .smart-cancel-header-card {
        padding: 12px 15px !important;
        margin-bottom: 12px !important;
        text-align: left;
    }

    .sc-search-wrapper {
        margin-top: 8px !important;
        margin-bottom: 15px !important;
    }

    .sc-address-line {
        align-items: flex-start;
    }

    .sc-address-line span {
        flex: 1;
        word-break: break-word;
        line-height: 1.4;
    }

    .sc-edit-btn {
        margin-left: 8px;
        flex-shrink: 0;
        margin-top: -2px;
        /* Visual alignment with text */
    }

    .sc-info-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 12px;
    }

    .sc-info-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 10px 12px !important;
        text-align: left;
        border-radius: 12px;
    }

    .sc-info-card i {
        font-size: 1.6rem !important;
        /* Slightly larger for visibility */
        margin-bottom: 0 !important;
        width: 36px;
        text-align: center;
        flex-shrink: 0;
        -webkit-text-fill-color: var(--primary-color) !important;
        /* Remove transparency on mobile for better visibility */
    }

    .sc-info-card-text {
        flex: 1;
    }

    .sc-info-card h4 {
        margin-bottom: 0px !important;
        font-size: 0.85rem !important;
    }

    .sc-info-card p {
        font-size: 0.72rem !important;
        line-height: 1.25 !important;
    }

    .sc-search-icon {
        left: 14px !important;
    }

    #sc-provider-search {
        padding: 10px 16px 10px 40px !important;
        font-size: 0.9rem !important;
        height: 42px !important;
    }
}

/* Unavailable / Disabled options */
.sc-unavailable {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(1);
}

/* Grouped Form Rows */
.sc-form-group-row {
    margin-bottom: 20px;
    grid-column: span 2;
    display: flex;
    gap: 15px;
}

@media (max-width: 500px) {
    .sc-form-group-row {
        flex-direction: column;
        gap: 10px;
    }

    .sc-form-group-row>.sc-form-group {
        flex: 1 1 auto !important;
    }
}

@media (max-width: 768px) {
    #sc-dynamic-form.sc-dynamic-form {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    #sc-dynamic-form .sc-span-2,
    #sc-dynamic-form .sc-form-group,
    #sc-dynamic-form .sc-form-group-row,
    #sc-dynamic-form .sc-row {
        grid-column: span 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
        display: flex !important;
    }

    #sc-dynamic-form .sc-form-group.group-main,
    #sc-dynamic-form .sc-form-group.group-side {
        flex: none !important;
        width: 100% !important;
    }

    #sc-dynamic-form .sc-form-group.group-side input {
        text-align: left;
    }

    #sc-dynamic-form .sc-info-alert {
        padding: 12px;
        font-size: 0.85rem;
        width: 100% !important;
        box-sizing: border-box;
    }

    #sc-dynamic-form .sc-form-group label {
        margin-bottom: 4px;
        font-weight: 600;
        display: block !important;
    }

    #sc-dynamic-form .sc-form-group input,
    #sc-dynamic-form .sc-form-group select {
        width: 100% !important;
        box-sizing: border-box;
        height: 48px !important;
        /* Better touch target */
    }

    /* Fix checkbox group alignment */
    #sc-dynamic-form .checkbox-group {
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
    }

    #sc-dynamic-form .checkbox-group input {
        width: 20px !important;
        height: 20px !important;
    }
}

.sc-delivery-warning {
    background: rgba(255, 171, 0, 0.1);
    border: 1px solid rgba(255, 171, 0, 0.3);
    color: #ffab00;
    padding: 12px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Info Alert (Aboalarm Style) */
.sc-info-alert {
    background: rgba(30, 136, 229, 0.1);
    border-left: 4px solid #1e88e5;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-main, #fff);
    line-height: 1.4;
    grid-column: span 2;
}

.sc-info-alert i {
    font-size: 1.25rem;
    color: #1e88e5;
}

/* Trust Footer */
.sc-trust-footer {
    grid-column: span 2;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.sc-trust-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.sc-trust-line i {
    color: #4caf50;
    font-size: 1rem;
}

.sc-trust-badge {
    display: inline-block;
}

.sc-badge-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sc-badge-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.sc-google-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.sc-google-rating i.ri-google-fill {
    font-size: 1.2rem;
    color: var(--text-main);
}

.sc-google-rating .stars {
    color: #ffb400;
    font-size: 0.7rem;
    display: flex;
    gap: 1px;
}

.sc-google-rating span {
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===== Premium Guarantee Badge Requirements ===== */
.sc-guarantee-badge-mini {
    position: relative;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    /* Dark Theme Base */
    background: linear-gradient(135deg, rgba(83, 33, 168, 0.6) 0%, rgba(30, 8, 50, 0.8) 100%);
    border: 1px solid rgba(167, 139, 250, 0.35);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

body.light-theme .sc-guarantee-badge-mini {
    background: linear-gradient(135deg, rgba(233, 222, 255, 0.8) 0%, rgba(255, 255, 255, 0.9) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 8px 30px rgba(124, 77, 255, 0.1), inset 0 1px 1px #fff;
}

/* Subtle animated glow line at the top */
.sc-guarantee-badge-mini::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.9), transparent);
    animation: sweepLinePremium 5s ease-in-out infinite;
    opacity: 0.8;
}

body.light-theme .sc-guarantee-badge-mini::before {
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.6), transparent);
}

@keyframes sweepLinePremium {
    0%, 20% { left: -100%; }
    80%, 100% { left: 200%; }
}

.sc-guarantee-badge-mini:hover {
    transform: translateY(-2px);
    border-color: rgba(167, 139, 250, 0.7);
    box-shadow: 0 12px 40px rgba(124, 77, 255, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

body.light-theme .sc-guarantee-badge-mini:hover {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 12px 35px rgba(124, 77, 255, 0.15), inset 0 1px 2px #fff;
    background: linear-gradient(135deg, rgba(228, 212, 255, 0.9) 0%, rgba(255, 255, 255, 1) 100%);
}

.sc-guarantee-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.sc-guarantee-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent icon from shrinking */
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(124, 77, 255, 0.15);
    border: 1px solid rgba(167, 139, 250, 0.3);
}

body.light-theme .sc-guarantee-icon-wrapper {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Icon background pulsing glow */
.sc-guarantee-icon-wrapper::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(167, 139, 250, 0.6);
    filter: blur(14px);
    z-index: -1;
    animation: slowPulsePremium 3s ease-in-out infinite alternate;
}

body.light-theme .sc-guarantee-icon-wrapper::after {
    background: rgba(139, 92, 246, 0.4);
}

@keyframes slowPulsePremium {
    0% { transform: scale(0.9); opacity: 0.3; }
    100% { transform: scale(1.6); opacity: 0.8; }
}

.sc-guarantee-badge-mini .ri-shield-check-fill {
    font-size: 1.6rem !important;
    background: linear-gradient(135deg, #e9d5ff 0%, #a78bfa 50%, #7c4dff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(124, 77, 255, 0.5));
}

body.light-theme .sc-guarantee-badge-mini .ri-shield-check-fill {
    background: linear-gradient(135deg, #7c4dff 0%, #5b21b6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(124, 77, 255, 0.3));
}

.sc-guarantee-text {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    line-height: 1.3;
}

.sc-guarantee-badge-mini strong {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 12px rgba(255, 255, 255, 0.2);
    margin-bottom: 2px;
}

body.light-theme .sc-guarantee-badge-mini strong {
    background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    font-weight: 800; /* Bolder for premium look */
}

.sc-guarantee-badge-mini small {
    font-size: 0.85rem;
    color: #d8b4fe; /* Lighter soft purple */
    font-weight: 400;
}

body.light-theme .sc-guarantee-badge-mini small {
    color: #5b21b6;
    font-weight: 500;
}

/* ===== Delivery Option Enhancements (Premium Look) ===== */

.sc-delivery-option {
    position: relative;
    border-radius: 14px;
    margin-bottom: 16px !important;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);

    /* Dark Theme Base */
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.light-theme .sc-delivery-option {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.sc-delivery-option label {
    display: block;
    padding: 16px 20px;
    cursor: pointer;
    margin-bottom: 0;
    color: var(--text-main);
}

.sc-delivery-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

/* Hover State */
.sc-delivery-option:hover {
    transform: translateY(-2px);
    border-color: rgba(167, 139, 250, 0.5);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 20px rgba(124, 77, 255, 0.15);
}

body.light-theme .sc-delivery-option:hover {
    border-color: rgba(139, 92, 246, 0.4);
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(124, 77, 255, 0.1);
}

/* Checked State - The Premium Glow */
.sc-delivery-option:has(input:checked) {
    border: 2px solid #a78bfa;
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.15) 0%, rgba(124, 77, 255, 0.05) 100%);
    box-shadow: 0 0 20px rgba(124, 77, 255, 0.3), inset 0 0 10px rgba(167, 139, 250, 0.1);
    padding: -1px; /* Offset the 2px border */
}

body.light-theme .sc-delivery-option:has(input:checked) {
    border: 2px solid #8b5cf6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(139, 92, 246, 0.01) 100%);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.2), inset 0 0 10px rgba(139, 92, 246, 0.05);
}

/* Top row: label + price */
.sc-delivery-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sc-delivery-label {
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    letter-spacing: 0.2px;
}

body.light-theme .sc-delivery-label {
    color: #1e1b4b;
}

.sc-delivery-label i {
    font-size: 1.4rem;
    background: linear-gradient(135deg, #d8b4fe 0%, #a78bfa 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 400 !important;
    padding: 0;
    margin-right: 4px;
    filter: drop-shadow(0 2px 4px rgba(124, 77, 255, 0.2));
    transition: all 0.3s ease;
}

body.light-theme .sc-delivery-label i {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    box-shadow: none;
    border: none;
}

.sc-delivery-option:hover .sc-delivery-label i {
    transform: scale(1.15) rotate(-5deg);
    filter: drop-shadow(0 4px 8px rgba(124, 77, 255, 0.4));
}

.sc-delivery-option:has(input:checked) .sc-delivery-label i {
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 10px rgba(124, 77, 255, 0.5));
    transform: scale(1.2);

    border-color: rgba(167, 139, 250, 0.8);
}

.sc-delivery-price {
    font-weight: 800;
    font-size: 1.25rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-theme .sc-delivery-price {
    color: #1e1b4b;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.sc-delivery-option:has(input:checked) .sc-delivery-price {
    background: rgba(167, 139, 250, 0.2);
    color: #d8b4fe;
    border-color: rgba(167, 139, 250, 0.3);
}

body.light-theme .sc-delivery-option:has(input:checked) .sc-delivery-price {
    background: rgba(139, 92, 246, 0.1);
    color: #6d28d9;
    border-color: rgba(139, 92, 246, 0.2);
}

.sc-option-free .sc-delivery-price {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

body.light-theme .sc-option-free .sc-delivery-price {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #059669 !important;
}

.sc-delivery-desc {
    display: block;
    color: var(--text-muted, #94a3b8);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 14px;
}

[data-theme="light"] .sc-delivery-desc {
    color: #475569;
}

/* Badges row */
.sc-delivery-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.sc-risk-badge,
.sc-speed-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.4px;
}

/* Maximale Sicherheit — green */
.sc-risk-max {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

[data-theme="light"] .sc-risk-max {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.2);
}

/* Hohe Sicherheit — blue/teal */
.sc-risk-high {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

[data-theme="light"] .sc-risk-high {
    background: rgba(6, 182, 212, 0.1);
    color: #0891b2;
    border-color: rgba(6, 182, 212, 0.2);
}

/* Mittlere Sicherheit — amber */
.sc-risk-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

[data-theme="light"] .sc-risk-medium {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.2);
}

/* Kein Nachweis — red */
.sc-risk-low {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

body.light-theme .sc-risk-low {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.2);
}

.sc-speed-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main, #e2e8f0);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

body.light-theme .sc-speed-badge {
    background: rgba(0, 0, 0, 0.05);
    color: #334155;
    border-color: rgba(0, 0, 0, 0.1);
}

/* Recommended option — golden glow */
.sc-delivery-recommended {
    border-color: rgba(251, 191, 36, 0.5) !important;
    background: rgba(251, 191, 36, 0.05) !important;
}

body.light-theme .sc-delivery-recommended {
    background: rgba(251, 191, 36, 0.08) !important;
}

.sc-delivery-recommended:has(input:checked) {
    border-color: #fbbf24 !important;
    box-shadow: 0 0 25px rgba(251, 191, 36, 0.3), inset 0 0 10px rgba(251, 191, 36, 0.1) !important;
}

.sc-recommended-tag {
    position: absolute;
    top: 0;
    right: 16px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #451a03;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: 0 0 10px 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    z-index: 2;
}

.sc-recommended-tag i {
    font-size: 0.8rem;
}

/* Info Box at bottom */
.sc-delivery-info-box {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 0.88rem;
    color: var(--text-main, #e2e8f0);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    line-height: 1.5;
    margin-top: 12px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

body.light-theme .sc-delivery-info-box {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
    color: #1e293b;
}

.sc-delivery-info-box i {
    color: #60a5fa;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}

body.light-theme .sc-delivery-info-box i {
    color: #2563eb;
}

.sc-delivery-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 0.88rem;
    color: #fbd38d;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    line-height: 1.5;
    margin-top: 12px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

body.light-theme .sc-delivery-warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.3);
    color: #b45309;
}

/* Ensure extremely long delivery labels wrap nicely without pushing everything else out */
.sc-delivery-label span[data-i18n] {
    word-break: break-word;
    white-space: normal;
}

/* Letter Generator Header */
.sc-letter-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 50px;
    font-family: Arial, sans-serif;
    position: relative;
    gap: 20px;
}

.sc-letter-recipient {
    margin-top: 30px;
    flex: 1;
}

.sc-letter-sender {
    text-align: right;
    font-size: 10pt;
    color: #000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-top: 30px;
}

/* Mobile Responsiveness for Delivery UI */
@media (max-width: 576px) {
    .sc-guarantee-badge-mini {
        padding: 14px 16px;
    }

    .sc-guarantee-content {
        gap: 12px;
    }

    .sc-guarantee-icon-wrapper {
        width: 38px;
        height: 38px;
    }
    
    .sc-guarantee-badge-mini .ri-shield-check-fill {
        font-size: 1.4rem !important;
    }

    .sc-guarantee-badge-mini strong {
        font-size: 0.95rem;
    }

    .sc-guarantee-badge-mini small {
        font-size: 0.8rem;
    }

    .sc-delivery-option label {
        padding: 12px 14px;
    }

    .sc-delivery-top {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
        width: 100%;
    }

    .sc-delivery-label {
        font-size: 0.95rem;
        gap: 8px;
        line-height: 1.2;
        flex: 1;
        min-width: 0;
    }

    .sc-delivery-label i {
        font-size: 1.15rem;
        padding: 6px;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .sc-delivery-price {
        font-size: 1.05rem;
        padding: 4px 10px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .sc-delivery-badges {
        gap: 6px;
    }

    .sc-risk-badge,
    .sc-speed-badge {
        font-size: 0.7rem;
        padding: 3px 10px;
    }

    .sc-recommended-tag {
        font-size: 0.65rem;
        padding: 3px 10px;
        right: 12px;
    }

    /* Letter Preview Mobile Fix */
    .sc-letter-header {
        flex-direction: column-reverse;
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .sc-letter-sender {
        align-items: flex-start;
        text-align: left;
        margin-top: 0;
        width: 100%;
        border-bottom: 1px dotted #ccc;
        padding-bottom: 15px;
    }
    
    .sc-letter-recipient {
        margin-top: 0;
    }
}

/* Editable Letter Area styles */
.sc-letter-editable-area { transition: background 0.2s ease, box-shadow 0.2s ease; }
.sc-letter-editable-area:hover { background: rgba(124, 77, 255, 0.05) !important; box-shadow: inset 0 0 0 1px rgba(124, 77, 255, 0.2); cursor: text; }


/* Fix select dropdown native colors in dark mode */
#view-smart_cancel select { color-scheme: dark; }
#view-smart_cancel select option { background-color: #130a21; color: #fff; }
#view-smart_cancel select option:checked { background-color: #7c4dff !important; color: #fff !important; }
/* Smart Cancel V2: conditional legal fields and accessible errors. */
.sc-field-error {
    margin-top: 6px;
    color: #ef4444;
    font-size: 0.78rem;
    line-height: 1.35;
}

.sc-reason-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.sc-reason-fields small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    line-height: 1.4;
}

#sc-signature-pad { touch-action: none; }

.sc-legal-acknowledgements {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.sc-legal-notice {
    display: flex;
    gap: 11px;
    padding: 13px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 14px;
    background: rgba(245, 158, 11, 0.08);
}

.sc-legal-notice > i {
    flex: 0 0 auto;
    color: #f59e0b;
    font-size: 1.2rem;
    margin-top: 1px;
}

.sc-legal-notice strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-primary, #fff);
    font-size: 0.84rem;
}

.sc-legal-notice p {
    margin: 0;
    color: var(--text-muted, #a8a3b5);
    font-size: 0.76rem;
    line-height: 1.45;
}

.sc-legal-check {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-secondary, #d1cddb);
    font-size: 0.76rem;
    line-height: 1.4;
    cursor: pointer;
}

.sc-legal-check:focus-within {
    border-color: rgba(124, 77, 255, 0.78);
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.14);
}

.sc-legal-check input {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    margin: 0;
    accent-color: #7c4dff;
}

.sc-legal-check a {
    display: inline-block;
    margin: 4px 8px 0 0;
    color: #a78bfa;
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sc-legal-check.sc-legal-check-error {
    border-color: rgba(239, 68, 68, 0.72);
    background: rgba(239, 68, 68, 0.07);
}

.sc-legal-error {
    margin: 0;
    color: #f87171;
    font-size: 0.78rem;
    font-weight: 650;
}

.sc-legal-error[hidden],
#sc_ack_immediate_row[hidden] {
    display: none !important;
}

body.light-theme .sc-legal-notice {
    background: #fff9eb;
    border-color: #f4d594;
}

body.light-theme .sc-legal-notice strong,
body.light-theme .sc-legal-check {
    color: #202124;
}

body.light-theme .sc-legal-notice p {
    color: #5f6368;
}

body.light-theme .sc-legal-check {
    background: #fff;
    border-color: #d9d9e3;
}

body.light-theme .sc-legal-check a {
    color: #5b45c8;
}

@media (max-width: 768px) {
    body.smart-cancel-wizard-active nav.mobile-nav-bar {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: translateY(calc(100% + var(--app-safe-bottom, 0px) + 24px)) !important;
    }

    .sc-reason-fields { grid-template-columns: 1fr; }

    .sc-legal-notice,
    .sc-legal-check {
        padding: 12px;
    }
}
