/**
 * Stage Plugin Styles
 */
:root {
    --stage-primary: #3498db;
    --stage-primary-dark: #2980b9;
    --stage-success: #27ae60;
    --stage-warning: #f39c12;
    --stage-danger: #e74c3c;
    --stage-text: #2c3e50;
    --stage-text-light: #7f8c8d;
    --stage-border: #ddd;
    --stage-bg: #f8f9fa;
    --stage-white: #fff;
    --stage-radius: 8px;
    --stage-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Reset margins for WordPress */
.stage-form-container p,
.stage-form p {
    margin: 0 !important;
    padding: 0 !important;
}

/* Container */
.stage-form-container {
    max-width: 700px !important;
    margin: 1.5rem auto !important;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* Form */
.stage-form {
    background: var(--stage-white);
    border-radius: var(--stage-radius);
    box-shadow: var(--stage-shadow);
    padding: 1.25rem;
}

.stage-form__title {
    color: var(--stage-text);
    margin: 0 0 1rem;
    text-align: center;
    font-size: 1.4rem;
}

/* Fieldset */
.stage-form__fieldset {
    border: 1px solid var(--stage-border);
    border-radius: var(--stage-radius);
    padding: 1rem;
    margin: 0 0 1rem;
}

.stage-form__fieldset legend {
    color: var(--stage-primary);
    font-weight: 600;
    padding: 0 0.5rem;
    font-size: 0.9rem;
}

/* Row - 2 colonnes desktop, 1 colonne mobile */
.stage-form__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.stage-form__row:last-child {
    margin-bottom: 0;
}

.stage-form__row > .stage-form__field {
    flex: 1 1 calc(50% - 0.375rem);
    min-width: 200px;
    margin-bottom: 0;
}

/* Field */
.stage-form__field {
    margin-bottom: 0.75rem;
}

.stage-form__field:last-child {
    margin-bottom: 0;
}

.stage-form__label {
    display: block;
    color: var(--stage-text);
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.stage-form__field input[type="text"],
.stage-form__field input[type="email"],
.stage-form__field input[type="tel"],
.stage-form__field select,
.stage-form__field textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--stage-border);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--stage-white);
    color: var(--stage-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.stage-form__field input:focus,
.stage-form__field select:focus,
.stage-form__field textarea:focus {
    outline: none;
    border-color: var(--stage-primary);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.stage-form__field textarea {
    resize: vertical;
    min-height: 70px;
}

/* Radio Group */
.stage-form__radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.stage-form__radio-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    margin: 0;
    background: var(--stage-white);
    border: 1px solid var(--stage-border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
    font-weight: normal;
}

.stage-form__radio-option:hover {
    border-color: var(--stage-primary);
    background: rgba(52, 152, 219, 0.04);
}

.stage-form__radio-option:has(input:checked) {
    border-color: var(--stage-primary);
    background: rgba(52, 152, 219, 0.08);
}

.stage-form__radio-option input[type="radio"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    accent-color: var(--stage-primary);
    cursor: pointer;
}

.stage-form__radio-content {
    display: flex;
    flex: 1;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.stage-form__radio-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--stage-text);
    margin: 0;
    padding: 0;
}

.stage-form__radio-price {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--stage-primary);
    white-space: nowrap;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

/* Price Summary */
.stage-form__price-summary {
    background: var(--stage-bg);
    border-radius: var(--stage-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.stage-form__price-summary h3 {
    margin: 0 0 0.5rem;
    color: var(--stage-text);
    font-size: 1rem;
}

.stage-form__price-details {
    display: flex;
    flex-direction: column;
}

.stage-form__price-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--stage-border);
    font-size: 0.9rem;
}

.stage-form__price-line:last-child {
    border-bottom: none;
}

.stage-form__price-line--total {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--stage-primary);
    border-top: 2px solid var(--stage-primary);
    border-bottom: none;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
}

/* Deposit Box - separate from recap */
.stage-form__deposit-box {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--stage-primary) 0%, var(--stage-primary-dark) 100%);
    border-radius: 6px;
    color: #fff ;
}

.stage-form__deposit-box * {
    color: #fff;
}

.stage-form__deposit-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.05rem;
}

.stage-form__deposit-note {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

/* Checkbox */
.stage-form__field--checkbox {
    margin-bottom: 1rem;
}

.stage-form__checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--stage-text);
}

.stage-form__checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin-top: 0.15rem;
    cursor: pointer;
    accent-color: var(--stage-primary);
    flex-shrink: 0;
}

.stage-form__checkbox-label span {
    flex: 1;
    font-size: 0.8rem;
    line-height: 1.4;
}

.stage-form__checkbox-label a {
    color: var(--stage-primary);
    text-decoration: underline;
}

.stage-form__checkbox-label a:hover {
    color: var(--stage-primary-dark);
}

/* Errors */
.stage-form__errors {
    background: #fef2f2;
    border: 1px solid var(--stage-danger);
    border-radius: var(--stage-radius);
    padding: 0.75rem;
    margin-bottom: 1rem;
    color: var(--stage-danger);
    font-size: 0.85rem;
}

/* Actions */
.stage-form__actions {
    text-align: center;
    margin-bottom: 0.75rem;
}

.stage-form__submit {
    background: var(--stage-primary);
    color: var(--stage-white);
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--stage-radius);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    width: 100%;
    max-width: 280px;
}

.stage-form__submit:hover {
    background: var(--stage-primary-dark);
}

.stage-form__submit:active {
    transform: scale(0.98);
}

.stage-form__submit:disabled {
    background: var(--stage-text-light);
    cursor: not-allowed;
}

.stage-form__secure {
    display: block;
    text-align: center;
    color: var(--stage-text-light);
    font-size: 0.8rem;
}

/* ========================================
   RESPONSIVE - Mobile (max 600px)
   ======================================== */
@media (max-width: 600px) {
    .stage-form-container {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }

    .stage-form {
        padding: 1rem;
        border-radius: 6px;
    }

    .stage-form__title {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }

    .stage-form__fieldset {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .stage-form__fieldset legend {
        font-size: 0.85rem;
    }

    /* Stack fields on mobile */
    .stage-form__row {
        flex-direction: column;
        gap: 0.6rem;
        margin-bottom: 0.6rem;
    }

    .stage-form__row > .stage-form__field {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .stage-form__field {
        margin-bottom: 0.6rem;
    }

    .stage-form__label {
        font-size: 0.8rem;
    }

    .stage-form__field input[type="text"],
    .stage-form__field input[type="email"],
    .stage-form__field input[type="tel"],
    .stage-form__field select,
    .stage-form__field textarea {
        padding: 0.5rem 0.6rem;
        font-size: 16px;
    }

    .stage-form__radio-option {
        padding: 0.4rem 0.6rem;
        gap: 0.5rem;
    }

    .stage-form__radio-label,
    .stage-form__radio-price {
        font-size: 0.8rem;
    }

    .stage-form__price-summary {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .stage-form__price-summary h3 {
        font-size: 0.9rem;
    }

    .stage-form__price-line {
        font-size: 0.85rem;
        padding: 0.35rem 0;
    }

    .stage-form__price-line--total {
        font-size: 1rem;
    }

    .stage-form__deposit-box {
        padding: 0.6rem 0.75rem;
        margin-top: 0.75rem;
    }

    .stage-form__deposit-line {
        font-size: 0.95rem;
    }

    .stage-form__deposit-note {
        font-size: 0.7rem;
    }

    .stage-form__submit {
        padding: 0.7rem 1.25rem;
        font-size: 0.95rem;
        max-width: none;
    }
}

/* ========================================
   RESPONSIVE - Small Mobile (max 380px)
   ======================================== */
@media (max-width: 380px) {
    .stage-form-container {
        padding: 0 0.25rem;
    }

    .stage-form {
        padding: 0.75rem;
    }

    .stage-form__fieldset {
        padding: 0.6rem;
    }

    .stage-form__radio-option {
        padding: 0.35rem 0.5rem;
    }

    .stage-form__radio-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }

    .stage-form__radio-label,
    .stage-form__radio-price {
        font-size: 0.75rem;
    }
}

/* ========================================
   Message Pages
   ======================================== */
.stage-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    max-width: 450px;
    margin: 2rem auto;
    padding: 1.5rem;
    text-align: center;
    background: var(--stage-white);
    border-radius: var(--stage-radius);
    box-shadow: var(--stage-shadow);
}

.stage-message__icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--stage-white);
    flex-shrink: 0;
}

.stage-message--success .stage-message__icon {
    background: var(--stage-success);
}

.stage-message--warning .stage-message__icon {
    background: var(--stage-warning);
}

.stage-message__title {
    color: var(--stage-text);
    margin: 0;
    font-size: 1.2rem;
}

.stage-message__text {
    color: var(--stage-text-light);
    margin: 0;
    font-size: 0.9rem;
}

.stage-message__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.25rem;
}

/* Buttons */
.stage-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    background: var(--stage-primary);
    color: var(--stage-white);
    text-decoration: none;
    border-radius: var(--stage-radius);
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.stage-button:hover {
    background: var(--stage-primary-dark);
    color: var(--stage-white);
}

.stage-button--secondary {
    background: var(--stage-bg);
    color: var(--stage-text);
    border: 1px solid var(--stage-border);
}

.stage-button--secondary:hover {
    background: var(--stage-border);
    color: var(--stage-text);
}

/* Loading State */
.stage-form--loading .stage-form__submit {
    position: relative;
    color: transparent;
}

.stage-form--loading .stage-form__submit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid var(--stage-white);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Message Pages Responsive */
@media (max-width: 600px) {
    .stage-message {
        margin: 1rem auto;
        padding: 1rem;
    }

    .stage-message__icon {
        width: 56px;
        height: 56px;
        font-size: 1.75rem;
    }

    .stage-message__title {
        font-size: 1.1rem;
    }

    .stage-button {
        width: 100%;
        padding: 0.7rem 1rem;
    }
}
