/* ================================
   R1 CONTACT FORM - FRONTEND STYLES
   Colors are injected dynamically via wp_add_inline_style.
   This file handles layout/structure only.
   ================================ */

.r1-contact-form-wrapper {
    max-width: 650px;
    margin: 0 auto;
    box-sizing: border-box;
}

.r1-contact-form-wrapper h2 {
    text-align: center;
    margin: 0 0 10px 0;
}

.r1-contact-form-wrapper p.r1-form-description {
    text-align: center;
    font-size: 15px;
    margin: 0 0 25px 0;
    line-height: 1.5;
}

/* Form message */
.r1-form-message {
    display: none;
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid transparent;
}
.r1-form-message.success { display: block; }
.r1-form-message.error { display: block; }

/* Form rows */
.r1-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 0;
}
.r1-form-row .r1-form-group { flex: 1; }

/* Form groups */
.r1-form-group { margin-bottom: 18px; }
.r1-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}
.r1-form-group label .required { color: #dc3545; }

/* Inputs */
.r1-form-group input[type="text"],
.r1-form-group input[type="email"],
.r1-form-group input[type="tel"],
.r1-form-group select,
.r1-form-group textarea {
    width: 100%;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}
.r1-form-group textarea {
    resize: vertical;
    min-height: 100px;
}
.r1-form-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Checkboxes */
.r1-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.r1-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
}
.r1-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Puzzle */
.r1-puzzle-container { margin: 25px 0; padding: 20px; border-radius: 8px; }
.r1-puzzle-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.r1-puzzle-header svg { width: 24px; height: 24px; }
.r1-puzzle-header h4 { margin: 0; font-size: 16px; font-weight: 600; }
.r1-puzzle-instruction { margin: 0 0 15px 0; font-size: 13px; }

.r1-slider-puzzle {
    position: relative;
    height: 50px;
    border-radius: 25px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}
.r1-slider-background {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: 0;
    transition: width 0.1s ease;
    border-radius: 25px;
}
.r1-slider-track {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.r1-slider-text { font-size: 14px; font-weight: 500; pointer-events: none; }
.r1-slider-puzzle.completed .r1-slider-text { opacity: 0; }

.r1-slider-handle {
    position: absolute;
    top: 5px; left: 5px;
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: left 0.3s ease, transform 0.1s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 2;
}
.r1-slider-handle:hover { transform: scale(1.05); }
.r1-slider-handle:active { cursor: grabbing; }
.r1-slider-handle svg { width: 22px; height: 22px; }
.r1-slider-puzzle.completed .r1-slider-handle { cursor: default; }

.r1-puzzle-success {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}
.r1-puzzle-success.show { display: flex; }
.r1-puzzle-success svg { width: 20px; height: 20px; flex-shrink: 0; }

/* Submit button */
.r1-form-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    margin-top: 5px;
    font-family: inherit;
    line-height: 1;
}
.r1-form-submit:active:not(:disabled) { transform: scale(0.98); }
@keyframes r1Pulse { 0%{transform:scale(1)} 50%{transform:scale(1.02)} 100%{transform:scale(1)} }
.r1-form-submit.pulse { animation: r1Pulse 0.6s ease; }

/* Responsive */
@media (max-width: 600px) {
    .r1-contact-form-wrapper { padding: 20px 15px !important; }
    .r1-contact-form-wrapper h2 { font-size: 22px !important; }
    .r1-form-row { flex-direction: column; gap: 0; }
    .r1-checkbox-group { flex-direction: column; gap: 10px; }
    .r1-slider-puzzle { height: 45px; }
    .r1-slider-handle { width: 36px; height: 36px; }
    .r1-slider-handle svg { width: 18px; height: 18px; }
}
