/**
 * Page de Connexion CGT - Styles
 * Charte graphique: Rouge CGT (#d00000) + Design moderne
 */

/* ================================
   VARIABLES & CONFIGURATION
   ================================ */
:root {
    --cgt-red: #d00000;
    --cgt-red-dark: #b00000;
    --cgt-red-light: #ff0000;
    --color-white: #ffffff;
    --color-black: #111111;
    --color-gray: #e5e7eb;
    --color-gray-dark: #6b7280;
    --color-gray-light: #f3f4f6;
    --radius: 16px;
    --radius-sm: 8px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --transition: 0.3s ease;
}

/* ================================
   PAGE PRINCIPALE
   ================================ */
.connexion-page {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
    background: linear-gradient(135deg, #f5f5f5 0%, #e5e7eb 100%);
}

.connexion-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.connexion-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.connexion-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: 0.35rem;
}

.connexion-header p {
    font-size: 1.125rem;
    color: var(--color-gray-dark);
}

/* ================================
   GRILLE DES BLOCS
   ================================ */
.connexion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 968px) {
    .connexion-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================
   BLOCS (CONNEXION & ADHÉSION)
   ================================ */
.connexion-bloc {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}

.connexion-bloc:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.bloc-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.bloc-icon {
    color: var(--cgt-red);
    flex-shrink: 0;
}

.bloc-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-black);
    margin: 0;
}

.bloc-description {
    color: var(--color-gray-dark);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* ================================
   FORMULAIRE DE CONNEXION
   ================================ */
.form-group {
    margin-bottom: 1rem;
}

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

.form-control {
    width: 90%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--color-gray);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--color-white);
}

.form-control:focus {
    outline: none;
    border-color: var(--cgt-red);
    box-shadow: 0 0 0 3px rgba(208, 0, 0, 0.1);
}

.form-control::placeholder {
    color: var(--color-gray-dark);
}

.account-request {
    margin: 1.25rem 0 0.75rem;
    text-align: center;
}

.account-request__trigger {
    background: transparent;
    border: 0;
    color: var(--cgt-red);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: 0.95rem;
}

.account-request__trigger:hover,
.account-request__trigger:focus {
    color: var(--cgt-red-dark);
}

/* Checkbox remember me */
.form-remember {
    margin-bottom: 1.5rem;
}

.form-remember label {
    display: flex;
    align-items: center;
    font-weight: 400;
    cursor: pointer;
}

.form-remember input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
    cursor: pointer;
    accent-color: var(--cgt-red);
}

/* ================================
   BOUTONS
   ================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.btn svg {
    flex-shrink: 0;
}

.btn-primary {
    background: var(--cgt-red);
    color: var(--color-white);
}

.btn-primary:hover {
    background: var(--cgt-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(208, 0, 0, 0.3);
}

.btn-secondary {
    background: var(--color-black);
    color: var(--color-white);
}

.btn-secondary:hover {
    background: #333333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--color-black);
    border: 2px solid var(--color-gray);
}

.btn-outline:hover {
    background: var(--color-gray-light);
    border-color: var(--color-gray-dark);
}

.btn-block {
    width: 100%;
}

/* ================================
   MESSAGES D'ERREUR/SUCCÈS
   ================================ */
.login-error {
    background: #fee2e2;
    border: 2px solid #ef4444;
    color: #991b1b;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.login-success {
	background: #dcfce7;
	border: 2px solid #16a34a;
	color: #166534;
	padding: 1rem;
	border-radius: var(--radius-sm);
	margin-bottom: 1.5rem;
	font-size: 0.9375rem;
}

.login-info {
	background: #e0f2fe;
	border: 2px solid #0ea5e9;
	color: #0c4a6e;
	padding: 1rem;
	border-radius: var(--radius-sm);
	margin-bottom: 1.5rem;
	font-size: 0.9375rem;
}

.adhesion-success {
    text-align: center;
    padding: 2rem;
}

.adhesion-success svg {
    color: #10b981;
    margin-bottom: 1rem;
}

.adhesion-success h3 {
    color: var(--color-black);
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
}

.adhesion-success p {
    color: var(--color-gray-dark);
    font-size: 1rem;
}

/* ================================
   LIENS
   ================================ */
.login-links {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-gray);
}

.lost-password {
    color: var(--cgt-red);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
}

.lost-password:hover {
    text-decoration: underline;
}

/* ================================
   TYPES D'ACCÈS
   ================================ */
.access-types {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-gray);
}

.access-type {
    text-align: center;
    padding: 1rem;
    background: var(--color-gray-light);
    border-radius: var(--radius-sm);
}

.access-type strong {
    display: block;
    color: var(--color-black);
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.access-type p {
    color: var(--color-gray-dark);
    font-size: 0.875rem;
    margin: 0;
}

/* ================================
   AVANTAGES ADHÉSION
   ================================ */
.adhesion-benefits {
    margin-bottom: 1.5rem;
}

.adhesion-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.adhesion-benefits li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    color: var(--color-black);
    font-size: 0.9375rem;
}

.adhesion-benefits li svg {
    color: var(--cgt-red);
    flex-shrink: 0;
}

/* ================================
   INFO COTISATION
   ================================ */
.cotisation-info {
    display: flex;
    gap: 0.75rem;
    background: #fef3c7;
    border: 2px solid #fbbf24;
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.cotisation-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.cotisation-text strong {
    display: block;
    color: var(--color-black);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.cotisation-text p {
    color: #78350f;
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

.email-link {
    color: var(--cgt-red);
    font-weight: 600;
    text-decoration: none;
}

.email-link:hover {
    text-decoration: underline;
}

/* ================================
   MODAL FORMULAIRE
   ================================ */
.adhesion-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--color-white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--color-gray);
    position: sticky;
    top: 0;
    background: var(--color-white);
    z-index: 10;
}

.modal-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-black);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--color-gray-dark);
    transition: color var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--cgt-red);
}

.modal-body {
    padding: 2rem;
}

/* ================================
   SECTIONS DU FORMULAIRE
   ================================ */
.form-section {
    margin-bottom: 2rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--cgt-red);
}

.section-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--cgt-red);
    color: var(--color-white);
    border-radius: 50%;
    font-size: 1.125rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ================================
   GRILLE FORMULAIRE
   ================================ */
.form-row {
    display: grid;
    gap: 1rem;
}

.form-row.form-row--gapped {
	column-gap: 1.6rem;
	row-gap: 1.2rem;
}

.form-row.form-row--tight {
    gap: 0.5rem;
    align-items: center;
}

.form-control.form-control--offset {
	padding-left: 1.1rem;
	padding-right: 1.1rem;
}

.form-row .form-group {
    margin-bottom: 0;
    padding-right:31px!important;
}

.col-1 {
    grid-column: span 1;
}

.col-2 {
    grid-column: span 1;
}

.col-4 {
    grid-column: span 1;
}

.col-6 {
    grid-column: span 1;
}

.col-8 {
    grid-column: span 2;
}

.col-12 {
    grid-column: span 3;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .col-4 {
        grid-column: span 1;
    }

    .col-6 {
        grid-column: span 1.5;
    }

    .col-8 {
        grid-column: span 2;
    }
}

@media (max-width: 767px) {
    .col-4,
    .col-6,
    .col-8 {
        grid-column: span 1;
    }

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

/* ================================
   SELECT & INPUT STYLES
   ================================ */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

input[type="date"].form-control {
    padding-right: 0.75rem;
}

/* ================================
   CHECKBOX STYLES
   ================================ */
.form-checkbox {
    margin-bottom: 1rem;
}

.form-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-weight: 400;
    cursor: pointer;
}

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

.required {
    color: var(--cgt-red);
    font-weight: 700;
}

/* ================================
   ACTIONS FORMULAIRE
   ================================ */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--color-gray);
}

.form-note {
    text-align: center;
    color: var(--color-gray-dark);
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* ================================
   MODALE DEMANDE DE COMPTE
   ================================ */
.account-request-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.account-request-modal.is-open {
    display: flex;
}

.account-request-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, 0.45);
}

.account-request-modal__content {
    position: relative;
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 2.5rem;
    max-width: min(640px, 92vw);
    width: 100%;
    box-shadow: var(--shadow-lg);
    z-index: 1;
}

.account-request-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--color-gray-dark);
}

.account-request-modal__header {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.account-request-modal__icon {
    font-size: 2rem;
}

.account-request-modal__header h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-black);
}

.account-request-modal__header p {
    margin: 0;
    color: var(--color-gray-dark);
}

.account-request-form {
    display: grid;
    gap: 1.5rem;
}

.account-request-form__grid {
    display: grid;
    gap: 1.25rem 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.account-request-form__field {
    display: grid;
    gap: 0.45rem;
}

.account-request-form__field--full {
    grid-column: 1 / -1;
}

.account-request-form__field span {
    font-weight: 600;
    color: var(--color-black);
}

.account-request-form__field input,
.account-request-form__field select {
    width: 90%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--color-gray);
    border-radius: var(--radius-sm);
    font: inherit;
    background: var(--color-white);
}

.account-request-form__field input:focus,
.account-request-form__field select:focus {
    outline: none;
    border-color: var(--cgt-red);
    box-shadow: 0 0 0 3px rgba(208, 0, 0, 0.12);
}

.account-request-form__message {
    display: none;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: rgba(208, 0, 0, 0.08);
    color: var(--cgt-red);
}

.account-request-form__message.is-visible {
    display: block;
}

.account-request-form__message.is-success {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.account-request-form__consent {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--color-gray-dark);
}

.account-request-form__consent input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    accent-color: var(--cgt-red);
}

.account-request-form__consent a {
    color: var(--cgt-red);
    text-decoration: underline;
}

.account-request-form__consent .required {
    color: var(--cgt-red);
    margin-left: 0.25rem;
}

.account-request-form__submit {
    font-weight: 700;
}

@media (max-width: 640px) {
    .account-request-modal__content {
        padding: 1.75rem;
    }

    .account-request-form__grid {
        grid-template-columns: 1fr;
    }
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 768px) {
    .connexion-page {
        padding: 2rem 0;
    }

    .connexion-header h1 {
        font-size: 2rem;
    }

    .connexion-bloc {
        padding: 1.75rem;
    }

    .modal-content {
        max-height: 95vh;
    }

    .modal-header,
    .modal-body {
        padding: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .access-types {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .connexion-header h1 {
        font-size: 1.75rem;
    }

    .connexion-header p {
        font-size: 1rem;
    }

    .bloc-header h2 {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.25rem;
    }
}

/* ================================
   SUBSECTIONS
   ================================ */
.form-subsection {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-gray);
}

.subsection-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-black);
    margin-bottom: 1rem;
}

/* ================================
   INPUT WITH SUFFIX (€)
   ================================ */
.form-input-with-suffix {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input-with-suffix input {
    padding-right: 3rem;
}

.input-suffix {
    position: absolute;
    right: 1rem;
    color: var(--color-gray-dark);
    font-weight: 600;
    pointer-events: none;
}

/* ================================
   FORM HELP TEXT
   ================================ */
.form-help {
    display: block;
    color: var(--color-gray-dark);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-style: italic;
}

/* ================================
   SIGNATURE PAD
   ================================ */
.signature-pad-wrapper {
    border: 2px solid var(--color-gray);
    border-radius: var(--radius-sm);
    padding: 1rem;
    background: var(--color-gray-light);
}

.signature-pad {
    display: block;
    width: 100%;
    height: 200px;
    border: 2px dashed var(--color-gray-dark);
    border-radius: var(--radius-sm);
    background: var(--color-white);
    cursor: crosshair;
    touch-action: none;
}

.signature-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ================================
   DATE INPUT GROUP
   ================================ */
.date-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.date-input-group .date-day {
    width: 70px !important;
    flex-shrink: 0;
    text-align: center;
}

.date-input-group .date-month {
    flex: 1;
    min-width: 140px;
    max-width: 180px;
    width: 100% !important;
}

.date-input-group .date-year {
    width: 120px !important;
    flex-shrink: 0;
}

.date-separator {
    color: var(--color-gray-dark);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1;
    user-select: none;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .date-input-group {
        flex-wrap: wrap;
    }

    .date-input-group .date-month {
        flex: 1;
        min-width: calc(50% - 1rem);
    }

    .date-input-group .date-year {
        width: calc(50% - 1rem);
    }
}

/* ================================
   UTILITY CLASSES
   ================================ */
.text-center {
    text-align: center;
}

/* ================================
   ANIMATIONS & TRANSITIONS
   ================================ */
.connexion-bloc,
.btn,
.form-control,
.modal-close {
    transition: all var(--transition);
}

/* Fade in animation pour les blocs */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.connexion-bloc {
    animation: fadeInUp 0.5s ease;
}

.connexion-bloc:nth-child(2) {
    animation-delay: 0.1s;
}
