/**
 * PBG LOGIN - STYLES
 * Style minimaliste avec grille de points animée
 * Couleur principale : Turquoise #8A9A7B
 * Polices : Archivo Black (titres) + Inter (body)
 */

/* ==========================
   VARIABLES CSS
   ========================== */
:root {
    --pbg-primary: #8A9A7B;
    --pbg-primary-dark: #7A8A6B;
    --pbg-dark: #2C2C2C;
    --pbg-black: #000;
    --pbg-white: #FFF;
    --pbg-gray: #666;
    --pbg-light: #F5F5F5;
    --pbg-error: #FF4444;
    --pbg-success: #00D084;
    --transition: all 0.3s ease;
}

/* ==========================
   RESET & BASE
   ========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==========================
   CONTAINER PRINCIPAL
   ========================== */
.pbg-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pbg-light);
    position: relative;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    padding: 40px 20px;
}

/* ==========================
   GRILLE DE POINTS ANIMÉE
   ========================== */
.pbg-dots-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(138, 154, 123, 0.15) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: moveGrid 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes moveGrid {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(30px, 30px);
    }
}

/* ==========================
   CONTAINER FORMULAIRE
   ========================== */
.pbg-login-container {
    position: relative;
    z-index: 1;
    background: var(--pbg-white);
    border: 3px solid var(--pbg-black);
    border-radius: 0;
    padding: 60px 50px;
    max-width: 500px;
    width: 100%;
    box-shadow: 
        8px 8px 0 rgba(0, 0, 0, 0.1),
        0 4px 20px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.pbg-login-container:hover {
    transform: translateY(-2px);
    box-shadow: 
        10px 10px 0 rgba(0, 0, 0, 0.15),
        0 8px 30px rgba(0, 0, 0, 0.08);
}

/* ==========================
   LOGO
   ========================== */
.pbg-logo {
    text-align: center;
    margin-bottom: 40px;
}

.pbg-logo img {
    max-width: 180px;
    height: auto;
    display: inline-block;
}

/* ==========================
   TITRE & SOUS-TITRE
   ========================== */
.pbg-login-title {
    font-family: 'Archivo Black', sans-serif;
    font-size: 36px;
    font-weight: 900;
    text-transform: uppercase;
    text-align: center;
    color: var(--pbg-black);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.pbg-login-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 400;
    text-align: center;
    color: var(--pbg-gray);
    margin-bottom: 40px;
}

/* ==========================
   MESSAGES (SUCCÈS / ERREUR)
   ========================== */
.pbg-message {
    padding: 15px 20px;
    border-radius: 0;
    margin-bottom: 30px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid;
    animation: slideDown 0.3s ease;
}

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

.pbg-message.success {
    background: rgba(0, 208, 132, 0.1);
    border-color: var(--pbg-success);
    color: var(--pbg-success);
}

.pbg-message.error {
    background: rgba(255, 68, 68, 0.1);
    border-color: var(--pbg-error);
    color: var(--pbg-error);
}

/* ==========================
   FORMULAIRE
   ========================== */
.pbg-form {
    width: 100%;
}

.pbg-form-group {
    margin-bottom: 25px;
}

.pbg-form-group label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--pbg-black);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pbg-form-group input[type="email"],
.pbg-form-group input[type="password"],
.pbg-form-group input[type="text"] {
    width: 100%;
    padding: 15px 18px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    border: 2px solid var(--pbg-black);
    border-radius: 0;
    background: var(--pbg-white);
    color: var(--pbg-black);
    transition: var(--transition);
}

.pbg-form-group input:focus {
    outline: none;
    border-color: var(--pbg-primary);
    box-shadow: 0 0 0 3px rgba(138, 154, 123, 0.1);
}

.pbg-form-group input::placeholder {
    color: var(--pbg-gray);
    opacity: 0.6;
}

/* ==========================
   MOT DE PASSE AVEC ŒIL
   ========================== */
.pbg-password-wrapper {
    position: relative;
}

.pbg-toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--pbg-gray);
}

.pbg-toggle-password:hover {
    color: var(--pbg-primary);
}

.pbg-toggle-password svg {
    width: 20px;
    height: 20px;
}

/* ==========================
   CHECKBOX "SE SOUVENIR"
   ========================== */
.pbg-checkbox-group {
    margin-bottom: 30px;
}

.pbg-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--pbg-gray);
    user-select: none;
}

.pbg-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    border: 2px solid var(--pbg-black);
    background: var(--pbg-white);
    margin-right: 10px;
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
}

.pbg-checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom {
    background: var(--pbg-primary);
    border-color: var(--pbg-primary);
}

.pbg-checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid var(--pbg-white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    font-weight: 500;
}

/* ==========================
   BOUTONS
   ========================== */
.pbg-btn {
    width: 100%;
    padding: 18px 30px;
    font-family: 'Archivo Black', sans-serif;
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 3px solid var(--pbg-black);
    border-radius: 0;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pbg-btn-primary {
    background: var(--pbg-primary);
    color: var(--pbg-black);
}

.pbg-btn-primary:hover:not(:disabled) {
    background: var(--pbg-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(138, 154, 123, 0.3);
}

.pbg-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loader spinner */
.spinner {
    animation: spin 0.8s linear infinite;
}

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

.spinner circle {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* ==========================
   FOOTER FORMULAIRE
   ========================== */
.pbg-form-footer {
    text-align: center;
    margin-top: 25px;
}

.pbg-link {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--pbg-primary);
    text-decoration: none;
    transition: var(--transition);
}

.pbg-link:hover {
    color: var(--pbg-primary-dark);
    text-decoration: underline;
}

/* ==========================
   FORMULAIRE MOT DE PASSE OUBLIÉ
   ========================== */
.pbg-back-link {
    margin-bottom: 25px;
}

.pbg-back-link a {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--pbg-gray);
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.pbg-back-link a:hover {
    color: var(--pbg-primary);
}

.pbg-form-subtitle {
    font-family: 'Archivo Black', sans-serif;
    font-size: 24px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--pbg-black);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.pbg-form-description {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--pbg-gray);
    margin-bottom: 30px;
    line-height: 1.6;
}

.pbg-hint {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: var(--pbg-gray);
    margin-top: 6px;
    font-style: italic;
}

/* ==========================
   RESPONSIVE
   ========================== */
@media (max-width: 600px) {
    .pbg-login-container {
        padding: 40px 30px;
        border-width: 2px;
        box-shadow: 
            5px 5px 0 rgba(0, 0, 0, 0.1),
            0 4px 20px rgba(0, 0, 0, 0.05);
    }
    
    .pbg-login-title {
        font-size: 28px;
    }
    
    .pbg-logo img {
        max-width: 140px;
    }
    
    .pbg-btn {
        font-size: 14px;
        padding: 16px 25px;
    }
}

@media (max-width: 400px) {
    .pbg-login-container {
        padding: 30px 20px;
    }
    
    .pbg-login-title {
        font-size: 24px;
    }
}

/* ==========================
   ANIMATIONS D'ENTRÉE
   ========================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pbg-login-container {
    animation: fadeInUp 0.5s ease;
}