/* ==========================================================================
   Roket Return & Complaint Forms — Frontend Styles
   ========================================================================== */

/* Wrapper */
.roket-form-wrapper {
    /* max-width: 520px; */
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Title */
.roket-form-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 28px 0;
    color: #1a1a1a;
    line-height: 1.3;
}

.roket-form-section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 32px 0 20px 0;
    padding-top: 24px;
    border-top: 1px solid #e5e5e5;
    color: #1a1a1a;
    line-height: 1.3;
}

/* Form */
.roket-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Fields */
.roket-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.roket-form-field label {
    font-size: 14px;
    font-weight: 400;
    color: #1a1a1a;
    line-height: 1.4;
}

.roket-form-field label .required {
    color: #e74c3c;
    font-weight: 400;
}

.roket-form-field label .optional {
    color: #999;
    font-weight: 400;
}

/* Inputs */
.roket-form input[type="text"],
.roket-form input[type="email"],
.roket-form input[type="tel"],
.roket-form input[type="date"],
.roket-form input[type="number"],
.roket-form textarea,
.roket-form select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #949494;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #1a1a1a;
    background-color: #F8F8F8;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.roket-form input:focus,
.roket-form textarea:focus,
.roket-form select:focus {
    border-color: #1a1a1a;
}

.roket-form input::placeholder,
.roket-form textarea::placeholder {
    color: #bbb;
}

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

/* Two column rows */
.roket-form-row--two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Short field (postal code) */
.roket-form-field--short {
    max-width: 200px;
}

/* Phone input */
.roket-phone-input {
    display: flex;
    align-items: center;
    border: 1px solid #949494;
    border-radius: 8px;
    overflow: hidden;
    background: #F8F8F8;
    transition: border-color 0.2s ease;
}

.roket-phone-input:focus-within {
    border-color: #1a1a1a;
}

.roket-phone-prefix {
    padding: 12px 0 12px 14px;
    font-size: 14px;
    color: #1a1a1a;
    white-space: nowrap;
    user-select: none;
    font-weight: 500;
}

.roket-phone-input input {
    border: none !important;
    padding-left: 8px !important;
    border-radius: 0 !important;
    flex: 1;
    background: transparent !important;
}

.roket-phone-input input:focus {
    border: none !important;
    box-shadow: none !important;
}

/* Select wrapper with custom arrow */
.roket-select-wrapper {
    position: relative;
}

.roket-select-wrapper select {
    padding-right: 40px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23333' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    line-height: 1.4;
    height: auto;
    min-height: 44px;
}

/* Image Upload */
.roket-image-upload-field {
    margin-top: 4px;
}

.roket-image-upload-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: stretch;
}

.roket-image-previews {
    display: none;
}

.roket-image-preview {
    position: relative;
    width: 97px;
    height: 129px;
    border-radius: 8px;
    overflow: visible;
    border: 1px solid #e5e5e5;
    background: #f9f9f9;
    flex-shrink: 0;
}

.roket-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

.roket-image-preview-inner {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.roket-image-preview .roket-image-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    background: #1a1a1a;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 2;
    transition: background-color 0.2s;
}

.roket-image-preview .roket-image-remove:hover {
    background: #333;
}

/* Upload button — full-width when no images, small square with images */
.roket-image-upload-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    background: #fff;
    box-sizing: border-box;
    padding: 14px 20px;
    flex-shrink: 0;
}

/* When images exist, switch to small square */
.roket-image-upload-btn.roket-upload-compact {
    width: 97px;
    height: 129px;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
}

.roket-image-upload-btn.roket-upload-compact .roket-upload-text {
    font-size: 10px;
}

.roket-image-upload-btn:hover {
    border-color: #1a1a1a;
    background: #fafafa;
}

.roket-image-upload-btn.roket-upload-hidden {
    display: none !important;
}

.roket-upload-icon {
    font-size: 22px;
    color: #1a1a1a;
    font-weight: 300;
    line-height: 1;
}

.roket-upload-text {
    font-size: 14px;
    color: #1a1a1a;
    text-align: center;
    line-height: 1.3;
}

.roket-file-input {
    display: none !important;
}

/* Max images notice */
.roket-image-notice {
    margin-top: 8px;
    padding: 10px 16px;
    background: #FFC107;
    color: #1a1a1a;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.roket-image-notice .roket-notice-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #1a1a1a;
    padding: 0 0 0 8px;
    line-height: 1;
    flex-shrink: 0;
}

/* Submit button */
.roket-form-submit {
    margin-top: 24px;
}

.roket-submit-btn {
    width: 100%;
    padding: 10px 24px;
    background-color: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    line-height: 150%;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    font-family: inherit;
}

.roket-submit-btn:hover {
    background-color: #333;
}

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

/* Messages */
.roket-form-message {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 4px;
    line-height: 1.5;
}

.roket-form-message.roket-message-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.roket-form-message.roket-message-error {
    background: #fbe9e7;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* Field error state */
.roket-form-field.roket-field-error input,
.roket-form-field.roket-field-error textarea,
.roket-form-field.roket-field-error select,
.roket-form-field.roket-field-error .roket-phone-input {
    border-color: #e74c3c;
}

/* Loading spinner on button */
.roket-submit-btn.roket-loading {
    position: relative;
    color: transparent;
}

.roket-submit-btn.roket-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: roketSpin 0.6s linear infinite;
}

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

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 600px) {
    .roket-form-wrapper {
        max-width: 100%;
    }

    .roket-form-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .roket-form-section-title {
        font-size: 16px;
        margin-top: 24px;
        padding-top: 20px;
    }

    .roket-form-row--two {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .roket-form-field--short {
        max-width: 100%;
    }

    .roket-image-preview {
        width: 80px;
        height: 80px;
    }
}
