
body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

#app {
    height: 100%;
}

*, *::before, *::after {
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

.step-content,
.memorial-preview-content,
.form-group input,
.form-group textarea,
.quill-editor,
.package-card,
.order-summary,
.optional-services-section,
.memorial-text-content,
.memorial-quote-text,
.memorial-name,
.memorial-subtitle {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.studio-container {
    display: flex;
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .studio-container {
        display: grid;
        grid-template-columns: 1.1fr 0.9fr;
    }
}

.editor-panel {
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    flex-direction: column;
    z-index: 10;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .editor-panel {
        border-right: 1px solid rgba(255, 255, 255, 0.08);
    }
}

.steps-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    background: linear-gradient(180deg, rgba(7, 10, 16, 0.65), rgba(7, 10, 16, 0.45));
    backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 50;
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.25);
    transition: all 0.3s ease;
    cursor: pointer;
}

.step-dot.active {
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
    transform: scale(1.2);
}

.step-dot.completed {
    background: #22c55e;
    border-color: #22c55e;
}

.editor-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

@media (min-width: 1024px) {
    .editor-content {
        max-height: calc(100dvh - var(--header-height) - var(--bottom-bar-height));
        overflow-y: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .editor-content::-webkit-scrollbar {
        display: none;
    }
}

.glass-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    margin: 20px;
    overflow: hidden;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .glass-card {
        margin: 8px;
        border-radius: 18px;
        max-width: calc(100vw - 16px);
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    .glass-card {
        margin: 6px;
        border-radius: 14px;
        max-width: calc(100vw - 12px);
    }
}

.step-content {
    padding: 28px;
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .step-content {
        padding: 20px 16px;
    }
}

.actions-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: linear-gradient(180deg, rgba(7, 10, 16, 0.45), rgba(7, 10, 16, 0.65));
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    bottom: 0;
    z-index: 40;
}

.mobile-preview-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #e5e7eb;
    cursor: pointer;
    transition: all 0.25s ease;
}

.mobile-preview-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

.preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1.5rem 0 0;
    overflow: hidden;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
}

@media (max-width: 1023px) {
    .studio-container {
        flex-direction: column;
        display: flex;
    }
    
    .editor-panel {
        max-width: 100%;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
    }
    
    .preview-panel {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 10;
        background: rgba(10, 10, 15, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 0;
        display: flex;
        flex-direction: column;
    }
    
    .studio-container:not(.show-preview) .preview-panel {
        visibility: hidden;
        pointer-events: none;
    }
    
    .studio-container.show-preview .preview-panel {
        visibility: visible;
        pointer-events: auto;
    }
    
    .mobile-preview-toggle {
        display: flex;
    }
    
    .preview-controls {
        display: none !important;
    }
    
    .mobile-back-btn {
        position: absolute;
        bottom: 2rem;
        left: 50%;
        transform: translateX(-50%);
        z-index: 100;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
}

.mobile-back-btn {
    display: none;
}

@media (max-width: 1023px) {
    .mobile-back-btn {
        display: inline-flex;
    }
}

.preview-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.25s ease;
}

.preview-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.preview-toggle-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(124, 58, 237, 0.3));
    border-color: rgba(99, 102, 241, 0.5);
    color: #fff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.preview-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
}

.preview-stage::-webkit-scrollbar {
    display: none;
}

.preview-frame {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.device-mockup {
    position: relative;
    flex-shrink: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.device-frame {
    background: #1a1a2e;
    border-radius: 20px;
    padding: 6px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.device-screen {
    background: #0f0f1a;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}

.device-shadow {
    position: absolute;
    bottom: -20px;
    left: 10%;
    right: 10%;
    height: 40px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.4) 0%, transparent 70%);
    filter: blur(10px);
    z-index: -1;
}

.preview-stage.mode-mobile .device-screen {
    width: 320px;
    height: 580px;
}

.preview-stage.mode-tablet .device-screen {
    width: 500px;
    height: 680px;
}

.preview-stage.mode-tablet .device-frame {
    border-radius: 16px;
    padding: 8px;
}

.preview-stage.mode-tablet .device-screen {
    border-radius: 10px;
}

.preview-stage.mode-desktop .device-frame {
    border-radius: 16px;
    padding: 8px 8px 8px 8px;
}

.preview-stage.mode-desktop .device-screen {
    max-width: 100%;
    height: calc(100dvh - 140px);
    border-radius: 8px;
}

.preview-stage.mode-desktop .device-mockup {
    width: 100%;
}

.preview-stage.mode-desktop .device-frame {
    width: 100%;
}

.memorial-preview-content {
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 16px;
    box-sizing: border-box;
}

.memorial-preview-content::-webkit-scrollbar {
    display: none;
}

.memorial-preview-content.memorial-page-container {
    min-height: 100% !important;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.memorial-preview-content .memorial-header-section {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    text-align: center;
}

.memorial-preview-content .memorial-main-photo {
    width: 120px !important;
    height: 120px !important;
    margin: 0 auto 16px !important;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

.preview-stage.mode-tablet .memorial-preview-content .memorial-main-photo {
    width: 160px !important;
    height: 160px !important;
}

.preview-stage.mode-desktop .memorial-preview-content .memorial-main-photo {
    width: 200px !important;
    height: 200px !important;
}

.memorial-preview-content .memorial-name {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.memorial-preview-content .memorial-dates {
    font-size: 0.9rem;
    opacity: 0.8;
}

.memorial-preview-content .memorial-subtitle {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 8px;
}

.memorial-preview-content .memorial-text-content {
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 12px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.memorial-preview-content .memorial-quote-section {
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin: 16px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.memorial-preview-content .memorial-quote-text {
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 35%, #22c55e 100%);
    color: #fff;
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(34, 197, 94, 0.35);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 480px) {
    .steps-nav {
        padding: 12px 16px;
        gap: 10px;
    }
    
    .step-dot {
        width: 10px;
        height: 10px;
    }
    
    .actions-bar {
        padding: 12px 16px;
        flex-wrap: wrap;
    }
    
    .preview-stage {
        padding: 16px;
    }
    
    .preview-stage.mode-mobile .device-screen {
        width: 280px;
        height: 500px;
    }
}

.step-container {
    display: none;
}

.step-container.active {
    display: block;
}

.package-card {
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.package-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.package-card.selected {
    border-color: #7c3aed;
    background: rgba(124, 58, 237, 0.1);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
}

.package-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #22c55e;
}

.input-group {
    margin-bottom: 1rem;
}

.input-label {
    display: block;
    font-weight: 500;
    color: #cbd5e1;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.modern-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.modern-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.modern-input::placeholder {
    color: #64748b;
}

.payment-section {
    margin-top: 1.5rem;
}

.payment-description {
    color: #94a3b8;
    margin-bottom: 1rem;
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.payment-method {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.payment-method:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.payment-method.active {
    border-color: #7c3aed;
    background: rgba(124, 58, 237, 0.1);
}

.payment-method.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.payment-method-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e5e7eb;
    font-weight: 500;
}

.payment-method-header i {
    font-size: 1.25rem;
    width: 28px;
    text-align: center;
}

.payment-method-description {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-left: 38px;
}

.payment-badge {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.active-badge {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.coming-soon-badge {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.card-details-section {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-top: 1rem;
}

.card-details-section h3 {
    margin: 0 0 0.5rem 0;
    color: #e5e7eb;
}

.card-description {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.stripe-card-container {
    padding: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
}

.stripe-card-errors {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 8px;
}

.order-summary h2,
.delivery-details h2,
.payment-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0 0 1rem 0;
    color: #e5e7eb;
}

.order-package-info h4,
.additional-services h4 {
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.selected-package {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.selected-package-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.selected-package-name {
    font-weight: 600;
    color: #e5e7eb;
}

.selected-package-price {
    font-weight: 700;
    color: #22c55e;
}

.selected-package-type {
    color: #94a3b8;
    font-size: 0.85rem;
}

.additional-services {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.service-option {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.service-option label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #cbd5e1;
}

.service-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #7c3aed;
}

.order-total {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    text-align: right;
}

.total-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #22c55e;
}

.delivery-details {
    margin-top: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.package-selection-section {
    margin-bottom: 2rem;
}

.package-selection-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0 0 1.5rem 0;
    color: #e5e7eb;
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .packages-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

.package-card {
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.package-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.package-card.selected {
    border-color: #7c3aed;
    background: rgba(124, 58, 237, 0.1);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
}

.package-card.featured {
    border-color: rgba(34, 197, 94, 0.4);
}

.package-card.featured.selected {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
}

.package-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.package-header {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.package-header h3 {
    margin: 0 0 0.5rem 0;
    color: #e5e7eb;
    font-size: 1.25rem;
}

.package-price {
    font-size: 2rem;
    font-weight: 700;
    color: #22c55e;
}

.package-price span {
    font-size: 1rem;
    font-weight: 400;
    color: #94a3b8;
}

.package-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.package-features li {
    padding: 0.5rem 0;
    color: #cbd5e1;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.package-features li:last-child {
    border-bottom: none;
}

.package-subtitle {
    color: #94a3b8;
    font-size: 0.85rem;
    margin: 0 0 1rem 0;
    text-align: center;
}

.package-note {
    color: #64748b;
    font-size: 0.8rem;
    text-align: center;
    margin: 1rem 0 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.optional-services-section {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.optional-services-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0 0 1rem 0;
    color: #e5e7eb;
}

.optional-services-content {
    color: #cbd5e1;
}

.optional-service-info h4 {
    color: #e5e7eb;
    font-size: 1rem;
    margin: 0 0 0.75rem 0;
}

.optional-service-info p {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.service-highlight {
    background: rgba(34, 197, 94, 0.1);
    border-left: 3px solid #22c55e;
    padding: 0.75rem 1rem;
    border-radius: 0 8px 8px 0;
    margin: 1rem 0;
}

.cost-factors {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
}

.cost-factors p {
    margin: 0 0 0.5rem 0;
}

.factor-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.factor {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

.contact-note {
    color: #7c3aed;
    font-weight: 500;
    margin-top: 1rem;
}
