/* ==========================================================================
   KS Prismatch — Frontend Styles
   Design: Matches offshoreudstyr.dk / billigkrangrej.dk
   Font: Poppins (body), Roboto (headings)
   Primary: #e74c3c
   ========================================================================== */

/* Wrapper */
.kspm-wrapper {
    max-width: 680px;
    margin: 0 auto;
    padding: 10px 0 40px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #444;
}

/* Header */
.kspm-header {
    text-align: center;
    margin-bottom: 28px;
}

.kspm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.1);
    color: var(--kspm-primary, #e74c3c);
    margin-bottom: 12px;
}

.kspm-title {
    font-family: 'Roboto', 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #333;
}

.kspm-subtitle {
    font-size: 14px;
    color: #777;
    margin: 0;
    max-width: 500px;
    display: inline-block;
    line-height: 1.6;
}

/* Form */
.kspm-form {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 28px;
}

/* Sections */
.kspm-section {
    margin-bottom: 24px;
}

.kspm-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    margin-bottom: 18px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.kspm-section-header svg {
    color: #888;
    flex-shrink: 0;
}

/* Fields */
.kspm-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

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

.kspm-field {
    margin-bottom: 14px;
}

.kspm-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    margin-bottom: 5px;
}

.kspm-required {
    color: var(--kspm-primary, #e74c3c);
}

.kspm-field input[type="text"],
.kspm-field input[type="email"],
.kspm-field input[type="tel"],
.kspm-field input[type="url"],
.kspm-field input[type="number"],
.kspm-field select,
.kspm-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    color: #333;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.kspm-field input:focus,
.kspm-field select:focus,
.kspm-field textarea:focus {
    outline: none;
    border-color: var(--kspm-primary, #e74c3c);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.kspm-field select {
    height: 42px;
    cursor: pointer;
}

.kspm-field textarea {
    resize: vertical;
    min-height: 70px;
}

.kspm-hint {
    display: block;
    font-size: 11px;
    color: #aaa;
    margin-top: 3px;
}

/* Price input with currency suffix */
.kspm-price-wrap {
    position: relative;
}

.kspm-price-wrap input {
    padding-right: 52px;
}

.kspm-currency {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: #999;
    pointer-events: none;
}

/* Product autocomplete */
.kspm-autocomplete {
    position: relative;
    z-index: 100;
}

.kspm-autocomplete-list {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 240px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

.kspm-autocomplete-list li {
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}

.kspm-autocomplete-list li:last-child {
    border-bottom: none;
}

.kspm-autocomplete-list li:hover,
.kspm-autocomplete-list li.active {
    background: #f8f8f8;
}

.kspm-autocomplete-list li .kspm-ac-name {
    font-weight: 500;
    color: #333;
}

.kspm-autocomplete-list li .kspm-ac-meta {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* Dropzone */
.kspm-dropzone {
    border: 2px dashed #ccc;
    border-radius: 6px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.kspm-dropzone:hover {
    border-color: var(--kspm-primary, #e74c3c);
    background: rgba(231, 76, 60, 0.02);
}

.kspm-dropzone.dragover {
    border-color: var(--kspm-primary, #e74c3c);
    background: rgba(231, 76, 60, 0.05);
}

.kspm-dropzone svg {
    display: block;
    margin: 0 auto 6px;
    color: #bbb;
}

.kspm-dropzone-text {
    font-size: 13px;
    color: #777;
    margin: 0;
}

.kspm-dropzone-hint {
    font-size: 11px;
    color: #aaa;
    margin: 4px 0 0;
}

/* File preview */
.kspm-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
    margin-top: 8px;
}

.kspm-preview-remove {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    margin-left: auto;
}

.kspm-preview-remove:hover {
    color: var(--kspm-primary, #e74c3c);
}

/* Submit button */
.kspm-submit {
    display: block;
    width: 100%;
    padding: 14px 28px;
    background: var(--kspm-primary, #e74c3c);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 6px;
}

.kspm-submit:hover {
    background: #c0392b;
}

.kspm-submit:active {
    transform: scale(0.99);
}

.kspm-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.kspm-disclaimer {
    font-size: 11px;
    color: #aaa;
    text-align: center;
    margin: 14px 0 0;
    line-height: 1.5;
}

/* Message box */
.kspm-message {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 14px;
}

.kspm-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.kspm-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Success state */
.kspm-success {
    text-align: center;
    padding: 40px 20px;
}

.kspm-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #d4edda;
    color: #27ae60;
    margin-bottom: 16px;
}

.kspm-success h3 {
    font-family: 'Roboto', sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #333;
}

.kspm-success p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 20px;
}

.kspm-new-request {
    display: inline-block;
    padding: 10px 24px;
    background: none;
    border: 2px solid var(--kspm-primary, #e74c3c);
    color: var(--kspm-primary, #e74c3c);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.kspm-new-request:hover {
    background: var(--kspm-primary, #e74c3c);
    color: #fff;
}

/* Trust badges */
.kspm-badges {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 28px;
}

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

.kspm-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 14px 16px;
}

.kspm-badge svg {
    color: #888;
    flex-shrink: 0;
}

.kspm-badge strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.kspm-badge span {
    display: block;
    font-size: 11px;
    color: #999;
}

/* Product page button */
.kspm-product-button {
    margin: 14px 0;
}

.kspm-btn-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: none;
    border: 1.5px solid var(--kspm-primary, #e74c3c);
    color: var(--kspm-primary, #e74c3c);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.kspm-btn-link:hover {
    background: var(--kspm-primary, #e74c3c);
    color: #fff;
}

.kspm-btn-link svg {
    flex-shrink: 0;
}

/* Loading spinner */
.kspm-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: kspm-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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