/**
 * RIX Offerte Router - Frontend Form Styles
 *
 * Responsive, mobile-first design matching the RIX huisstijl.
 * Inherits the theme font-family; provides sensible defaults for colors.
 */

/* Variables via custom properties */
:root {
    --rix-primary: #1a2a4a;
    --rix-primary-light: #2c4470;
    --rix-primary-hover: #243a5e;
    --rix-accent: #fe7c00;          /* RIX Orange */
    --rix-accent-hover: #d26700;    /* Darker Orange */
    --rix-success: #0ca7e4;         /* RIX Blue */
    --rix-bg: #ffffff;
    --rix-bg-inputs: #f7f9fb;
    --rix-bg-alt: #f0f4f8;
    --rix-border: #e2e8f0;
    --rix-border-focus: #0ca7e4;
    --rix-text: #1f2937;
    --rix-text-light: #64748b;
    --rix-error: #ef4444;
    --rix-radius: 12px;
    --rix-radius-sm: 8px;
    --rix-shadow-sm: 0 2px 4px rgba(26, 42, 74, 0.05);
    --rix-shadow-md: 0 10px 25px rgba(26, 42, 74, 0.08);
    --rix-shadow-glow: 0 4px 15px rgba(254, 124, 0, 0.3);
}

/* Wrapper -- inherits font from theme */
.rix-offerte-wrap {
    max-width: 720px;
    margin: 0 auto;
    font-family: inherit;
    color: var(--rix-text);
    line-height: 1.6;
}

/* Form */
.rix-offerte-form {
    background: var(--rix-bg);
    border-radius: var(--rix-radius);
    padding: 30px;
    box-shadow: 0 15px 35px rgba(26, 42, 74, 0.04);
    border: 1px solid rgba(26, 42, 74, 0.05);
}

@media(max-width: 600px) {
    .rix-offerte-form { 
        padding: 20px; 
    }
}

/* Title */
.rix-offerte-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--rix-primary);
    margin: 0 0 28px 0;
    padding: 0;
    border: none;
}

/* Routing feedback */
.rix-routing-feedback {
    padding: 14px 20px;
    border-radius: var(--rix-radius);
    margin-bottom: 28px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.rix-routing-feedback.rix-routing-match {
    background: #eef4ff;
    border: 1px solid #a8c8f5;
    color: #1a3f6f;
}

.rix-routing-feedback.rix-routing-fallback {
    background: #fef9ee;
    border: 1px solid #f0d88a;
    color: #7a5a10;
}

.rix-routing-feedback.rix-routing-invalid {
    background: #fef2f2;
    border: 1px solid #f5a8a8;
    color: #8b1a1a;
}

.rix-routing-feedback .rix-routing-name {
    font-weight: 700;
}

/* Sections */
.rix-section {
    margin-bottom: 36px;
}

.rix-section-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--rix-primary);
    margin: 0 0 18px 0;
    padding: 0;
    border: none;
}

/* Task blocks */
.rix-task-block {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--rix-border);
    border-radius: var(--rix-radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--rix-shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.rix-task-block::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    background: var(--rix-success);
    opacity: 0.5;
}

.rix-task-block:hover {
    box-shadow: var(--rix-shadow-md);
    border-color: rgba(12, 167, 228, 0.2);
    transform: translateY(-2px);
}
.rix-task-block:hover::before {
    opacity: 1;
}

.rix-task-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.rix-task-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--rix-primary);
    margin: 0;
}

/* Remove task button */
.rix-remove-task-btn {
    background: none;
    border: 1px solid var(--rix-border);
    border-radius: var(--rix-radius);
    color: var(--rix-text-light);
    font-size: 20px;
    line-height: 1;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.rix-remove-task-btn:hover {
    color: #ffffff;
    background: #dc2626;
    border-color: #dc2626;
}

/* Add task button */
.rix-add-task-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--rix-primary);
    background: var(--rix-bg-alt);
    border: 1px solid var(--rix-border);
    border-radius: var(--rix-radius);
    cursor: pointer;
    text-align: center;
    margin-top: 4px;
    transition: all 0.2s ease;
}

.rix-add-task-btn:hover {
    background: var(--rix-primary);
    color: #ffffff;
    border-color: var(--rix-primary);
}

/* Field groups */
.rix-field-group {
    margin-bottom: 16px;
}

.rix-field-group:last-child {
    margin-bottom: 0;
}

.rix-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--rix-text);
    margin-bottom: 5px;
}

.rix-required {
    color: var(--rix-error);
}

/* Input fields */
.rix-input,
.rix-textarea {
    width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.5;
    color: var(--rix-text);
    background: var(--rix-bg-inputs);
    border: 1px solid var(--rix-border);
    border-radius: var(--rix-radius-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.rix-input:hover, .rix-textarea:hover {
    background: var(--rix-bg);
    border-color: #cbd5e1;
}

.rix-input:focus,
.rix-textarea:focus {
    outline: none;
    background: var(--rix-bg);
    border-color: var(--rix-border-focus);
    box-shadow: 0 0 0 4px rgba(12, 167, 228, 0.15);
}

.rix-input.rix-input-error,
.rix-textarea.rix-input-error {
    border-color: var(--rix-error);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.rix-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Drag & Drop File Zone */
.rix-file-upload-zone {
    width: 100%;
    border: 2px dashed var(--rix-border);
    border-radius: var(--rix-radius);
    background: var(--rix-bg-inputs);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.rix-file-upload-zone:hover, .rix-file-upload-zone.rix-drag-over {
    border-color: var(--rix-success);
    background: rgba(12, 167, 228, 0.05);
}

.rix-file-icon {
    color: var(--rix-success);
    margin-bottom: 12px;
    transition: transform 0.3s ease;
}

.rix-file-upload-zone:hover .rix-file-icon {
    transform: translateY(-4px);
}

.rix-file-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--rix-primary);
    margin: 0 0 6px 0;
}

.rix-file-subtext {
    font-size: 13px;
    color: var(--rix-text-light);
    display: block;
}

.rix-input-file-hidden {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Previews */
.rix-file-preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.rix-preview-item {
    position: relative;
    border-radius: var(--rix-radius-sm);
    overflow: hidden;
    box-shadow: var(--rix-shadow-sm);
    aspect-ratio: 1;
    background: var(--rix-bg-alt);
}

.rix-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rix-preview-name {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 10px;
    padding: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* Field rows (side by side) */
.rix-field-row {
    display: flex;
    gap: 16px;
}

.rix-field-half {
    flex: 1;
}

@media (max-width: 540px) {
    .rix-field-row {
        flex-direction: column;
        gap: 0;
    }
}



/* Field error */
.rix-field-error {
    display: block;
    font-size: 13px;
    color: var(--rix-error);
    margin-top: 4px;
}

/* Privacy checkbox */
.rix-section-privacy {
    padding: 18px 24px;
    background: var(--rix-bg-alt);
    border: none;
    border-radius: var(--rix-radius);
    box-shadow: var(--rix-shadow-sm);
}

.rix-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
}

.rix-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--rix-accent);
}

.rix-checkbox-label a {
    color: var(--rix-accent);
    text-decoration: underline;
}

.rix-checkbox-label a:hover {
    color: var(--rix-accent-hover);
}

/* Submit button */
.rix-section-submit {
    text-align: center;
    margin-top: 16px;
}

.rix-submit-btn {
    position: relative;
    display: block;
    width: 100%;
    padding: 18px 40px;
    font-size: 17px;
    font-family: inherit;
    font-weight: 700;
    letter-spacing: 1px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--rix-accent) 0%, #f99026 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: var(--rix-shadow-glow);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-transform: uppercase;
    overflow: hidden;
}

/* Shine effect */
.rix-submit-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    transition: all 0.6s ease;
}

.rix-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(254, 124, 0, 0.4);
    background: linear-gradient(135deg, var(--rix-accent-hover) 0%, var(--rix-accent) 100%);
}

.rix-submit-btn:hover::after {
    left: 150%;
}

.rix-submit-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(254, 124, 0, 0.3);
}

/* Submitting state - turns to RIX Blue */
.rix-submit-btn.is-submitting {
    background: linear-gradient(135deg, var(--rix-success) 0%, #30baf2 100%);
    box-shadow: 0 4px 15px rgba(12, 167, 228, 0.4);
    pointer-events: none;
}

.rix-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
