/* =====================================================
   TURBOPROG - Ticket System Styles
   En harmonie avec style.css existant
   ===================================================== */

/* Page d'entrée */
.ticket-entry {
    padding: clamp(56px, 8vw, 100px) 0;
}

.ticket-entry__header {
    max-width: 720px;
    margin: 0 auto var(--space-12);
    text-align: center;
}

.ticket-entry__intro {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-top: var(--space-4);
}

/* Options de création */
.ticket-entry__options {
    display: grid;
    gap: var(--space-6);
    max-width: 900px;
    margin: 0 auto;
}

.ticket-option {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    padding: var(--space-8);
    background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: all var(--speed-2);
    position: relative;
    overflow: hidden;
}

.ticket-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), #67ffd1);
    opacity: 0;
    transition: opacity var(--speed-2);
}

.ticket-option:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 226, 166, 0.3);
    box-shadow: 0 12px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(0,226,166,.15) inset;
}

.ticket-option:hover::before {
    opacity: 1;
}

.ticket-option__icon {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 226, 166, 0.1);
    border: 1px solid rgba(0, 226, 166, 0.2);
    border-radius: var(--radius-sm);
    color: var(--brand);
}

.ticket-option__icon--alt {
    background: rgba(106, 133, 255, 0.1);
    border-color: rgba(106, 133, 255, 0.2);
    color: #6a85ff;
}

.ticket-option__content {
    flex: 1;
}

.ticket-option__title {
    font: 600 1.25rem/1.3 "Poppins", sans-serif;
    margin: 0 0 var(--space-2);
    color: var(--text);
}

.ticket-option__desc {
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.5;
    margin: 0;
}

.ticket-option__arrow {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: transform var(--speed-1);
}

.ticket-option:hover .ticket-option__arrow {
    transform: translateX(4px);
    color: var(--brand);
}

/* Info box */
.ticket-entry__info {
    max-width: 720px;
    margin: var(--space-12) auto 0;
}

.info-box {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-6);
    background: rgba(106, 133, 255, 0.05);
    border: 1px solid rgba(106, 133, 255, 0.15);
    border-radius: var(--radius-sm);
    color: var(--text);
}

.info-box svg {
    flex-shrink: 0;
    color: #6a85ff;
    margin-top: 2px;
}

.info-box p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--muted);
}

/* ===================================================== */
/* Formulaires */
/* ===================================================== */

.ticket-form {
    padding: clamp(56px, 8vw, 100px) 0;
}

.ticket-form__header {
    max-width: 800px;
    margin: 0 auto var(--space-10);
    text-align: center;
}

.ticket-form__title {
    font: 700 clamp(1.8rem, 3vw, 2.2rem)/1.15 "Poppins", sans-serif;
    margin: 0 0 var(--space-3);
}

.ticket-form__subtitle {
    font-size: 1.05rem;
    color: var(--muted);
    line-height: 1.6;
}

/* Container du formulaire */
.ticket-form__container {
    max-width: 900px;
    margin: 0 auto;
    background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--space-10);
}

/* Sections du formulaire */
.form-section {
    margin-bottom: var(--space-10);
}

.form-section:last-of-type {
    margin-bottom: 0;
}

.form-section__title {
    font: 600 1.2rem/1.3 "Poppins", sans-serif;
    color: var(--text);
    margin: 0 0 var(--space-2);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--line);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.form-section__icon {
    width: 24px;
    height: 24px;
    color: var(--brand);
}

/* Groupes de champs */
.form-group {
    margin-bottom: var(--space-6);
}

.form-group--inline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
}

/* Labels */
.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: var(--space-2);
}

.form-label--required::after {
    content: '*';
    color: var(--danger);
    margin-left: 4px;
}

.form-label-helper {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 400;
    margin-top: 4px; /* En dessous maintenant */
    line-height: 1.4;
}

/* Inputs & Textareas */
.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--speed-1);
}

.form-control:focus {
    outline: none;
    border-color: var(--brand);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(0, 226, 166, 0.1);
}

.form-control::placeholder {
    color: var(--muted);
    opacity: 0.6;
}

.form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

/* Select custom */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%239aa6b2' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 48px;
}

/* Checkboxes */
.form-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    cursor: pointer;
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    transition: background var(--speed-1);
}

.form-checkbox:hover {
    background: rgba(255, 255, 255, 0.02);
}

.form-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--brand);
    cursor: pointer;
    flex-shrink: 0;
}

.form-checkbox-label {
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.5;
    cursor: pointer;
}

/* Radio buttons */
.form-radio-group {
    display: grid;
    gap: var(--space-3);
}

.form-radio {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--speed-1);
}

.form-radio:hover {
    border-color: rgba(0, 226, 166, 0.3);
    background: rgba(255, 255, 255, 0.04);
}

.form-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand);
    cursor: pointer;
}

.form-radio-label {
    color: var(--text);
    font-size: 0.95rem;
    flex: 1;
    cursor: pointer;
}

/* Validation states */
.form-control.is-invalid {
    border-color: var(--danger);
}

.form-control.is-valid {
    border-color: var(--ok);
}

.form-error {
    display: block;
    margin-top: var(--space-2);
    font-size: 0.85rem;
    color: var(--danger);
    font-weight: 500;
}

.form-success {
    display: block;
    margin-top: var(--space-2);
    font-size: 0.85rem;
    color: var(--ok);
    font-weight: 500;
}

/* Signature pad */
.signature-container {
    margin-top: var(--space-4);
}

.signature-pad {
    width: 100%;
    height: 200px;
    border: 2px dashed var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    cursor: crosshair;
    touch-action: none;
}

.signature-pad.has-signature {
    border-style: solid;
    border-color: var(--brand);
}

.signature-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

/* Boutons du formulaire */
.form-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: flex-end;
    margin-top: var(--space-10);
    padding-top: var(--space-8);
    border-top: 1px solid var(--line);
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 50px;
    padding: 0 2rem;
    background: linear-gradient(180deg, var(--brand), #2ee1b5);
    color: #05332a;
    font: 600 1rem "Inter";
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: transform var(--speed-1), box-shadow var(--speed-1);
    box-shadow: 0 4px 12px rgba(0, 226, 166, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 226, 166, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 50px;
    padding: 0 1.5rem;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: 600 0.95rem "Inter";
    border: 1px solid var(--line);
    border-radius: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--speed-1);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text);
}

/* Loading state */
.form-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-6);
    background: rgba(0, 226, 166, 0.1);
    border: 1px solid rgba(0, 226, 166, 0.2);
    border-radius: var(--radius-sm);
    color: var(--brand);
    font-weight: 600;
    margin-top: var(--space-6);
}

.form-loading.active {
    display: flex;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 226, 166, 0.2);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Success message */
.success-message {
    display: none;
    padding: var(--space-8);
    background: linear-gradient(180deg, rgba(110, 231, 168, 0.15), rgba(110, 231, 168, 0.05));
    border: 1px solid rgba(110, 231, 168, 0.3);
    border-radius: var(--radius);
    text-align: center;
}

.success-message.active {
    display: block;
}

.success-message__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-4);
    color: var(--ok);
}

.success-message__title {
    font: 600 1.5rem/1.3 "Poppins", sans-serif;
    color: var(--text);
    margin: 0 0 var(--space-3);
}

.success-message__text {
    font-size: 1rem;
    color: var(--muted);
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto var(--space-6);
}

.success-message__reference {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: rgba(0, 226, 166, 0.1);
    border: 1px solid rgba(0, 226, 166, 0.2);
    border-radius: var(--radius-sm);
    color: var(--brand);
    font: 600 1rem "Inter";
    margin-bottom: var(--space-6);
}

/* Responsive */
@media (max-width: 768px) {
    .ticket-form__container {
        padding: var(--space-6);
    }
    
    .form-group--inline {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .btn-submit,
    .btn-cancel {
        width: 100%;
    }
    
    .ticket-option {
        flex-direction: column;
        text-align: center;
    }
    
    .ticket-option__arrow {
        transform: rotate(90deg);
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   TOAST NOTIFICATIONS - Style simple
   À ajouter à la fin de ticket.css
   ======================================== */

.option-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--danger);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 420px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    z-index: 9999;
    pointer-events: none;
}

.option-toast.show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.option-toast--success {
    border-left-color: var(--ok);
}

.option-toast--info {
    border-left-color: var(--brand);
}

/* Responsive */
@media (max-width: 640px) {
    .option-toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

/* ========================================
   BADGE BETA
   ======================================== */

.badge-beta {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--brand), #00b890);
    color: var(--bg);
    border-radius: 100px;
    margin-left: 0.75rem;
    vertical-align: middle;
    box-shadow: 0 2px 8px rgba(0, 226, 166, 0.3);
    animation: pulse-beta 2s ease-in-out infinite;
}


/* Responsive */
@media (max-width: 768px) {
    .badge-beta {
        display: block;
        margin: 0.5rem auto 0;
        width: fit-content;
    }
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 22px;
    background: rgba(255, 92, 98, 0.08);
    border: 1px solid rgba(255, 92, 98, 0.25);
    border-radius: 12px;
    color: var(--danger);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-logout:hover {
    background: rgba(255, 92, 98, 0.14);
    border-color: rgba(255, 92, 98, 0.4);
    color: var(--danger);
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-logout svg {
    transition: transform 0.2s ease;
}

.btn-logout:hover svg {
    transform: translateX(3px);
}