/**
 * Dansk Jordvarme - Tilbudsformular Widget Styles
 */

/* Container */
.djv-tilbud-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Progress Bar */
.djv-progress-wrapper {
    margin-bottom: 30px;
}

.djv-progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    position: relative;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.djv-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.djv-step.active {
    background-color: #2ecc71;
    color: #fff;
}

.djv-step.completed {
    background-color: #2ecc71;
    color: #fff;
}

.djv-progress-bar {
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.djv-progress-fill {
    height: 100%;
    background-color: #2ecc71;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Header */
.djv-tilbud-header {
    text-align: center;
    margin-bottom: 30px;
}

.djv-tilbud-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #1a1a1a;
}

.djv-tilbud-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Form Sections */
.djv-form-section {
    margin-bottom: 30px;
}

.djv-section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #333;
}

/* Step Content */
.djv-step-content {
    display: none;
}

.djv-step-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Option Grid */
.djv-option-grid {
    display: grid;
    gap: 15px;
}

.djv-customer-type-grid {
    grid-template-columns: repeat(3, 1fr);
}

.djv-pump-type-grid {
    grid-template-columns: repeat(3, 1fr);
}

.djv-heating-grid,
.djv-building-grid {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .djv-customer-type-grid,
    .djv-pump-type-grid,
    .djv-heating-grid,
    .djv-building-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .djv-customer-type-grid,
    .djv-pump-type-grid,
    .djv-heating-grid,
    .djv-building-grid {
        grid-template-columns: 1fr;
    }
}

/* Option Cards */
.djv-option-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fff;
    text-align: center;
}

.djv-option-card:hover {
    border-color: #ccc;
    background-color: #fafafa;
}

.djv-option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.djv-option-card.selected,
.djv-option-card input[type="radio"]:checked + .djv-option-check + .djv-option-icon + .djv-option-label,
.djv-option-card:has(input[type="radio"]:checked) {
    border-color: #2ecc71;
    background-color: #f0fff4;
}

.djv-option-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background-color: #fff;
    transition: all 0.2s ease;
}

.djv-option-card input[type="radio"]:checked ~ .djv-option-check,
.djv-option-card.selected .djv-option-check {
    border-color: #2ecc71;
    background-color: #2ecc71;
}

.djv-option-card input[type="radio"]:checked ~ .djv-option-check::after,
.djv-option-card.selected .djv-option-check::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

.djv-option-icon {
    font-size: 32px;
    margin-bottom: 10px;
    line-height: 1;
}

.djv-option-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* Option Cards with Images */
.djv-option-card-with-image {
    padding: 0;
    overflow: hidden;
}

.djv-option-card-with-image .djv-option-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.djv-option-card-with-image .djv-option-label {
    padding: 15px;
    display: block;
    width: 100%;
}

.djv-option-card-with-image .djv-option-check {
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.9);
}

/* Large Option Cards (for pump types) */
.djv-option-card-large {
    padding: 25px 20px;
    align-items: flex-start;
    text-align: left;
}

.djv-option-card-large .djv-option-content {
    width: 100%;
}

.djv-option-icon-large {
    font-size: 40px;
    margin-bottom: 15px;
    display: block;
}

.djv-option-label-large {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    display: block;
    margin-bottom: 8px;
}

/* Option Cards with Description */
.djv-option-card-with-desc {
    padding-bottom: 15px;
}

.djv-option-card-with-desc .djv-option-label {
    margin-bottom: 8px;
}

.djv-option-description {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    display: block;
    padding: 0 10px;
    text-align: center;
}

.djv-option-card-with-image.djv-option-card-with-desc .djv-option-description {
    padding: 0 15px 15px 15px;
}

.djv-option-card-with-image.djv-option-card-with-desc .djv-option-label {
    padding-bottom: 8px;
}

/* Form Fields */
.djv-form-row {
    margin-bottom: 20px;
}

.djv-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.djv-form-group {
    display: flex;
    flex-direction: column;
}

.djv-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.djv-form-group label .required {
    color: #e74c3c;
}

.djv-form-group input[type="text"],
.djv-form-group input[type="email"],
.djv-form-group input[type="tel"],
.djv-form-group input[type="number"],
.djv-form-group textarea,
.djv-form-group select {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.djv-form-group input:focus,
.djv-form-group textarea:focus,
.djv-form-group select:focus {
    outline: none;
    border-color: #2ecc71;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

.djv-form-group input::placeholder,
.djv-form-group textarea::placeholder {
    color: #999;
}

.djv-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Checkbox */
.djv-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}

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

.djv-checkbox-custom {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    margin-right: 12px;
    margin-top: 2px;
    transition: all 0.2s ease;
    position: relative;
}

.djv-checkbox-label input[type="checkbox"]:checked + .djv-checkbox-custom {
    background-color: #2ecc71;
    border-color: #2ecc71;
}

.djv-checkbox-label input[type="checkbox"]:checked + .djv-checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

.djv-checkbox-text {
    color: #666;
}

.djv-checkbox-text a {
    color: #2ecc71;
    text-decoration: underline;
}

.djv-checkbox-text a:hover {
    color: #27ae60;
}

/* Buttons */
.djv-form-actions {
    margin-top: 30px;
}

.djv-form-actions-split {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.djv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.djv-btn-primary {
    background-color: #2ecc71;
    color: #fff;
}

.djv-btn-primary:hover {
    background-color: #27ae60;
    transform: translateY(-1px);
}

.djv-btn-secondary {
    background-color: #f5f5f5;
    color: #666;
}

.djv-btn-secondary:hover {
    background-color: #e0e0e0;
}

.djv-btn-arrow {
    margin-left: 8px;
    font-size: 18px;
}

.djv-btn-secondary .djv-btn-arrow {
    margin-left: 0;
    margin-right: 8px;
}

.djv-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spinner */
.djv-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

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

/* Success Message */
.djv-success-message {
    text-align: center;
    padding: 40px 20px;
    animation: fadeIn 0.3s ease;
}

.djv-success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #2ecc71;
    color: #fff;
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.djv-success-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px 0;
}

.djv-success-text {
    font-size: 16px;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

/* Error Message */
.djv-error-message {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 15px 20px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.djv-error-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #ef4444;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.djv-error-text {
    font-size: 14px;
    color: #991b1b;
    margin: 0;
}

/* Privacy Note */
.djv-privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    font-size: 13px;
    color: #888;
}

.djv-privacy-icon {
    margin-right: 8px;
}

/* Field Validation */
.djv-form-group.has-error input,
.djv-form-group.has-error textarea {
    border-color: #ef4444;
}

.djv-form-group .djv-field-error {
    font-size: 12px;
    color: #ef4444;
    margin-top: 5px;
}

/* Select dropdown for compact mode */
.djv-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

.djv-select:focus {
    outline: none;
    border-color: #2ecc71;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

/* ============================================
   COMPACT LAYOUT STYLES
   ============================================ */

.djv-layout-compact {
    max-width: 400px;
}

.djv-layout-compact .djv-tilbud-header {
    margin-bottom: 20px;
}

.djv-layout-compact .djv-tilbud-title {
    font-size: 20px;
    margin-bottom: 5px;
}

.djv-layout-compact .djv-tilbud-subtitle {
    font-size: 14px;
}

.djv-layout-compact .djv-progress-wrapper {
    margin-bottom: 20px;
}

.djv-layout-compact .djv-progress-steps {
    max-width: 150px;
}

.djv-layout-compact .djv-step {
    width: 26px;
    height: 26px;
    font-size: 12px;
}

.djv-layout-compact .djv-form-section {
    margin-bottom: 15px;
}

.djv-layout-compact .djv-section-title {
    font-size: 15px;
    margin-bottom: 12px;
}

.djv-layout-compact .djv-form-row {
    margin-bottom: 12px;
}

.djv-layout-compact .djv-form-group label {
    font-size: 13px;
    margin-bottom: 5px;
}

.djv-layout-compact .djv-form-group input,
.djv-layout-compact .djv-form-group textarea,
.djv-layout-compact .djv-select {
    padding: 10px 12px;
    font-size: 14px;
}

.djv-layout-compact .djv-btn {
    padding: 10px 20px;
    font-size: 14px;
}

.djv-layout-compact .djv-form-actions {
    margin-top: 15px;
}

.djv-layout-compact .djv-privacy-note {
    font-size: 11px;
    margin-top: 15px;
    padding-top: 12px;
}

.djv-layout-compact .djv-checkbox-label {
    font-size: 12px;
}

.djv-layout-compact .djv-checkbox-custom {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

/* ============================================
   MINIMAL LAYOUT STYLES
   ============================================ */

.djv-layout-minimal {
    max-width: 350px;
}

.djv-layout-minimal .djv-tilbud-header {
    margin-bottom: 15px;
}

.djv-layout-minimal .djv-tilbud-title {
    font-size: 18px;
    margin-bottom: 0;
}

.djv-layout-minimal .djv-form-section {
    margin-bottom: 0;
}

.djv-layout-minimal .djv-form-row {
    margin-bottom: 10px;
}

.djv-layout-minimal .djv-form-group label {
    font-size: 12px;
    margin-bottom: 4px;
    color: #555;
}

.djv-layout-minimal .djv-form-group input,
.djv-layout-minimal .djv-form-group textarea,
.djv-layout-minimal .djv-select {
    padding: 8px 10px;
    font-size: 14px;
    border-width: 1px;
    border-radius: 6px;
}

.djv-layout-minimal .djv-btn {
    padding: 10px 16px;
    font-size: 14px;
    width: 100%;
    border-radius: 6px;
}

.djv-layout-minimal .djv-form-actions {
    margin-top: 12px;
}

.djv-layout-minimal .djv-form-actions-split {
    flex-direction: column;
    gap: 8px;
}

.djv-layout-minimal .djv-btn-secondary {
    order: 2;
}

.djv-layout-minimal .djv-privacy-note {
    font-size: 10px;
    margin-top: 12px;
    padding-top: 10px;
    text-align: center;
}

.djv-layout-minimal .djv-checkbox-label {
    font-size: 11px;
    line-height: 1.4;
}

.djv-layout-minimal .djv-checkbox-custom {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    margin-top: 1px;
}

.djv-layout-minimal .djv-success-message {
    padding: 25px 15px;
}

.djv-layout-minimal .djv-success-icon {
    width: 50px;
    height: 50px;
    font-size: 24px;
    margin-bottom: 12px;
}

.djv-layout-minimal .djv-success-title {
    font-size: 18px;
}

.djv-layout-minimal .djv-success-text {
    font-size: 13px;
}

/* Hide step 2 content in compact/minimal modes (goes directly to step 3) */
.djv-layout-compact .djv-step-content[data-step="2"],
.djv-layout-minimal .djv-step-content[data-step="2"] {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .djv-tilbud-container {
        padding: 20px 15px !important;
    }
    
    .djv-tilbud-title {
        font-size: 22px;
    }
    
    .djv-form-actions-split {
        flex-direction: column-reverse;
    }
    
    .djv-btn {
        width: 100%;
    }
    
    .djv-option-card-large {
        padding: 20px 15px;
    }
    
    .djv-option-label-large {
        font-size: 16px;
    }

    /* Compact and minimal already mobile-friendly */
    .djv-layout-compact,
    .djv-layout-minimal {
        max-width: 100%;
    }
}
