/* ============================================
   FORMS STYLES - PMEJob
   Styles dédiés aux formulaires d'inscription et connexion
   ============================================ */

:root {
    --primary: #92D400;
    --primary-dark: #7ab800;
    --secondary: #3e3e3e;
    --magenta: #b50eaf;
    --light: #faf9f6;
    --white: #ffffff;
    --gray: #6b7280;
    --gray-light: #f1f5f9;
    --error: #ef4444;
    --success: #10b981;
}

/* ============================================
   FORM SECTIONS
   ============================================ */

.form-section {
    padding: 4rem 5%;
    background: white;
}

.form-section .container {
    max-width: 800px;
    margin: 0 auto;
}

/* ============================================
   FORM HEADER
   ============================================ */

.form-header {
    text-align: center;
    margin-bottom: 3rem;
}

.form-title {
    font-family: 'Baloo 2', cursive;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.form-subtitle {
    color: var(--gray);
    font-size: 1rem;
}

.form-subtitle a {
    color: var(--magenta);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s;
}

.form-subtitle a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ============================================
   MESSAGES (Success / Error)
   ============================================ */

.message {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: none;
    font-weight: 500;
}

.message.show {
    display: block;
    animation: slideDown 0.5s ease;
}

.error-message.show,
.success-message.show {
    display: block !important;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: none;
    font-weight: 500;
    background: #fee;
    border-left: 4px solid var(--error);
    color: var(--error);
}

.success-message {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: none;
    font-weight: 500;
    background: #d1fae5;
    border-left: 4px solid var(--success);
    color: var(--success);
}

/* ============================================
   FORM CONTAINER
   ============================================ */

.signup-form {
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
}

/* ============================================
   FORM LAYOUT
   ============================================ */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* ============================================
   FORM LABELS
   ============================================ */

.form-label {
    display: block;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.required {
    color: var(--error);
    margin-left: 0.25rem;
}

/* ============================================
   INPUT WRAPPER & ICONS
   ============================================ */

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--gray);
    transition: color 0.3s;
    z-index: 1;
    pointer-events: none;
}

/* ============================================
   FORM INPUTS
   ============================================ */

.form-input,
.form-select {
    width: 100%;
    padding: 1rem 1rem 1rem 3.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s;
    background: white;
    color: var(--secondary);
}

.form-input::placeholder {
    color: #9ca3af;
}

/* Focus States */
.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(146, 212, 0, 0.1);
}

.form-input:focus ~ .input-icon,
.form-select:focus ~ .input-icon {
    color: var(--primary);
}

/* Error State */
.form-input.error,
.form-select.error {
    border-color: var(--error);
}

.form-input.error:focus,
.form-select.error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* ============================================
   SELECT DROPDOWN
   ============================================ */

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.2rem center;
    padding-right: 3rem;
}

.form-select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2392D400' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

/* ============================================
   CHECKBOX & CGU
   ============================================ */

.cgu-wrapper {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    margin-bottom: 2rem;
    transition: all 0.3s;
}

.cgu-wrapper:has(input:focus) {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(146, 212, 0, 0.1);
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

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

.cgu-text {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.6;
}

.cgu-text a {
    color: var(--magenta);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.cgu-text a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */

.btn-submit {
    width: 100%;
    padding: 1.2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Baloo 2', cursive;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 25px rgba(146, 212, 0, 0.3);
}

.btn-submit:hover {
    background: var(--magenta);
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(181, 14, 175, 0.4);
}

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

.btn-submit:disabled {
    background: var(--gray);
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

/* ============================================
   HELPER TEXTS
   ============================================ */

.helper-text {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 0.5rem;
}

.error-text {
    font-size: 0.85rem;
    color: var(--error);
    margin-top: 0.5rem;
    display: none;
}

.error-text.show {
    display: block;
}

/* ============================================
   MODAL FORMS
   ============================================ */

.modal-content .form-group {
    margin-bottom: 1.5rem;
}

.modal-content .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--secondary);
}

.modal-content .form-input,
.modal-content .form-select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--light);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
}

.modal-content .form-input:focus,
.modal-content .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(146, 212, 0, 0.1);
}

.modal-content .form-input::placeholder {
    color: var(--gray);
}

.modal-content .checkbox-group {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.modal-content .checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 0.2rem;
    cursor: pointer;
    accent-color: var(--primary);
}

.modal-content .checkbox-group label {
    font-size: 0.9rem;
    color: var(--gray);
    line-height: 1.6;
}

.modal-content .checkbox-group a {
    color: var(--primary);
    text-decoration: none;
}

.modal-content .checkbox-group a:hover {
    text-decoration: underline;
}

.modal-content .form-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--light);
}

.modal-content .form-footer p {
    color: var(--gray);
    font-size: 0.95rem;
}

.modal-content .form-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.modal-content .form-footer a:hover {
    text-decoration: underline;
}

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

@media (max-width: 1024px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .signup-form {
        padding: 2rem;
    }

    .form-title {
        font-size: 2rem;
    }

    .form-input,
    .form-select {
        padding: 0.875rem 0.875rem 0.875rem 3rem;
    }

    .input-icon {
        left: 1rem;
        font-size: 1rem;
    }

    .cgu-wrapper {
        padding: 1rem;
    }

    .btn-submit {
        font-size: 1.1rem;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .form-section {
        padding: 2rem 5%;
    }

    .signup-form {
        padding: 1.5rem;
    }

    .form-header {
        margin-bottom: 2rem;
    }

    .form-title {
        font-size: 1.75rem;
    }

    .form-row {
        gap: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }
}

/* ============================================
   UTILITIES
   ============================================ */

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.5rem;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.3s;
    border-radius: 2px;
}

.password-strength-bar.weak {
    width: 33%;
    background: var(--error);
}

.password-strength-bar.medium {
    width: 66%;
    background: #f59e0b;
}

.password-strength-bar.strong {
    width: 100%;
    background: var(--success);
}

/* Loading State */
.btn-submit.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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