/* ===================================
   PAGE CONTACT - Noun Qalam
   Style moderne et oriental
   =================================== */

/* Section principale */
.contact-section {
    padding: 40px 20px 60px;
    min-height: calc(100vh - 200px);
    background: linear-gradient(180deg, var(--color-primary-very-light) 0%, white 100%);
}

.contact-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* En-tête */
.contact-header {
    text-align: center;
    margin-bottom: 50px;
}

.contact-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.contact-decoration .decoration-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-primary-hard));
}

.contact-decoration .decoration-line:last-child {
    background: linear-gradient(90deg, var(--color-primary-hard), transparent);
}

.contact-decoration .decoration-symbol {
    color: var(--color-primary-hard);
    font-size: 18px;
}

.contact-header h1 {
    font-family: var(--font-secondary);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-primary-hard);
    margin: 0 0 12px 0;
}

.contact-subtitle {
    color: var(--color-secondary-light);
    font-size: 1.1rem;
    font-weight: 300;
    margin: 0;
    max-width: 500px;
    margin: 0 auto;
}

/* Layout principal */
.contact-content {
}

/* Formulaire */
.contact-form-wrapper {
    background: white;
    padding: 35px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(155, 103, 75, 0.1);
    border: 1px solid var(--color-primary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* Groupes de formulaire */
.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--color-secondary);
    font-size: 0.9rem;
}

.form-group label .required {
    color: var(--color-primary-hard);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Input wrapper */
.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--color-primary-hard);
    opacity: 0.6;
    pointer-events: none;
    z-index: 1;
}

/* Champs de saisie */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group select {
    width: 100%;
    padding: 14px 14px 14px 45px;
    border: 1px solid var(--color-primary);
    border-radius: 12px;
    font-size: 15px;
    font-family: var(--font-primary);
    color: var(--color-secondary);
    background: var(--color-primary-very-light);
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
}

.form-group input::placeholder {
    color: var(--color-secondary-light);
    opacity: 0.5;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary-hard);
    background: white;
    box-shadow: 0 0 0 3px rgba(155, 103, 75, 0.1);
}

/* Select avec flèche custom */
.select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--color-primary-hard);
    opacity: 0.6;
    pointer-events: none;
}

/* Options de civilité */
.civility-options {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.civility-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.civility-option input[type="radio"] {
    display: none;
}

.civility-label {
    padding: 10px 24px;
    border: 1px solid var(--color-primary);
    border-radius: 25px;
    font-size: 0.9rem;
    color: var(--color-secondary);
    background: var(--color-primary-very-light);
    transition: all 0.3s ease;
}

.civility-option:hover .civility-label {
    border-color: var(--color-primary-hard);
    background: var(--color-primary-light);
}

.civility-option input[type="radio"]:checked + .civility-label {
    background: var(--color-primary-hard);
    color: white;
    border-color: var(--color-primary-hard);
}

/* Textarea */
.textarea-wrapper {
    position: relative;
}

.textarea-wrapper textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--color-primary);
    border-radius: 12px;
    font-size: 15px;
    font-family: var(--font-primary);
    color: var(--color-secondary);
    background: var(--color-primary-very-light);
    transition: all 0.3s ease;
    resize: vertical;
    min-height: 140px;
}

.textarea-wrapper textarea::placeholder {
    color: var(--color-secondary-light);
    opacity: 0.5;
}

.textarea-wrapper textarea:focus {
    outline: none;
    border-color: var(--color-primary-hard);
    background: white;
    box-shadow: 0 0 0 3px rgba(155, 103, 75, 0.1);
}

/* Compteur de caractères */
.char-counter {
    position: absolute;
    bottom: 12px;
    right: 14px;
    font-size: 0.75rem;
    color: var(--color-secondary-light);
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
}

.char-counter.warning {
    color: #e67e22;
    font-weight: 500;
}

/* Bouton submit */
.btn-submit {
    width: 100%;
    padding: 16px 28px;
    background: linear-gradient(135deg, var(--color-primary-hard) 0%, #7a523c 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(155, 103, 75, 0.35);
}

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

.btn-arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.btn-submit:hover:not(:disabled) .btn-arrow {
    transform: translateX(5px);
}

/* Spinner de chargement */
.btn-loading {
    display: inline-flex;
    align-items: center;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* ===================================
   ALERTES (Succès / Erreur)
   =================================== */

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.alert svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.alert span {
    font-size: 0.95rem;
    line-height: 1.4;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #28a745;
    color: #155724;
}

.alert-success svg {
    color: #28a745;
}

.alert-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #dc3545;
    color: #721c24;
}

.alert-error svg {
    color: #dc3545;
}

/* ===================================
   CAPTCHA VISUEL
   =================================== */

.captcha-group {
    margin-top: 10px;
}

.captcha-container {
    background: var(--color-primary-very-light);
    border: 2px dashed var(--color-primary);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.captcha-instruction {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.captcha-text {
    font-size: 1rem;
    color: var(--color-secondary);
    font-weight: 500;
}

.captcha-target {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: white;
    border: 2px solid var(--color-primary-hard);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(155, 103, 75, 0.2);
}

.captcha-target svg {
    width: 100%;
    height: 100%;
    color: var(--color-primary-hard);
}

.captcha-options {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.captcha-option {
    width: 56px;
    height: 56px;
    background: white;
    border: 2px solid var(--color-primary);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.captcha-option svg {
    width: 100%;
    height: 100%;
    color: var(--color-secondary-light);
    transition: color 0.3s ease;
}

.captcha-option:hover {
    border-color: var(--color-primary-hard);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 103, 75, 0.15);
}

.captcha-option:hover svg {
    color: var(--color-primary-hard);
}

.captcha-option.selected {
    transform: scale(1.05);
}

.captcha-option.correct {
    border-color: #28a745;
    background: #d4edda;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.captcha-option.correct svg {
    color: #28a745;
}

.captcha-option.wrong {
    border-color: #dc3545;
    background: #f8d7da;
}

.captcha-option.wrong svg {
    color: #dc3545;
}

/* Animation shake pour mauvaise réponse */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.captcha-option.shake {
    animation: shake 0.5s ease-in-out;
}

.captcha-feedback {
    margin-top: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    min-height: 22px;
    transition: all 0.3s ease;
}

.captcha-feedback.success {
    color: #28a745;
}

.captcha-feedback.error {
    color: #dc3545;
}

/* Bouton désactivé */
.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Informations de contact */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card {
    background: white;
    padding: 22px;
    border-radius: 16px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border: 1px solid var(--color-primary);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(155, 103, 75, 0.12);
}

.info-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-icon svg {
    width: 24px;
    height: 24px;
    color: var(--color-primary-hard);
}

.info-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-secondary);
    margin: 0 0 6px 0;
}

.info-content p {
    font-size: 0.9rem;
    color: var(--color-secondary-light);
    margin: 0;
}

/* Liens sociaux */
.social-links {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.social-link {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-light);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.social-link svg {
    width: 18px;
    height: 18px;
    color: var(--color-primary-hard);
}

.social-link:hover {
    background: var(--color-primary-hard);
}

.social-link:hover svg {
    color: white;
}

/* Décoration orientale */
.oriental-decoration {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    margin-top: 10px;
}

.arabic-calligraphy {
    font-family: var(--font-arabic);
    font-size: 3rem;
    color: var(--color-primary-hard);
    margin-bottom: 8px;
    line-height: 1.2;
}

.decoration-text {
    font-size: 0.9rem;
    color: var(--color-secondary-light);
    font-style: italic;
    margin: 0;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 900px) {
    .contact-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .contact-info {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .oriental-decoration {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .contact-section {
        padding: 30px 15px 50px;
    }

    .contact-header h1 {
        font-size: 2.5rem;
    }

    .contact-subtitle {
        font-size: 1rem;
    }

    .contact-form-wrapper {
        padding: 25px 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .civility-options {
        gap: 10px;
    }

    .civility-label {
        padding: 8px 18px;
        font-size: 0.85rem;
    }

    .contact-info {
        grid-template-columns: 1fr;
    }

    .oriental-decoration {
        grid-column: span 1;
    }

    .info-card {
        padding: 18px;
    }

    .info-icon {
        width: 42px;
        height: 42px;
        min-width: 42px;
    }

    .info-icon svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 400px) {
    .contact-decoration .decoration-line {
        width: 40px;
    }

    .contact-header h1 {
        font-size: 2.2rem;
    }

    .civility-options {
        flex-direction: column;
    }

    .civility-option {
        width: 100%;
    }

    .civility-label {
        width: 100%;
        text-align: center;
    }

    .arabic-calligraphy {
        font-size: 2.5rem;
    }

    /* Captcha responsive */
    .captcha-container {
        padding: 15px;
    }

    .captcha-target {
        width: 45px;
        height: 45px;
    }

    .captcha-option {
        width: 48px;
        height: 48px;
        padding: 8px;
    }

    .captcha-options {
        gap: 8px;
    }

    .captcha-text {
        font-size: 0.9rem;
    }
}
