:root {
    --color-bg: #f5f5fa;
    --color-primary: #28a745; /* Vert de la maquette */
    --color-primary-hover: #218838;
    --color-border: #000000;
    --color-text: #333;
    --color-text-secondary: #666;
    --color-sidebar-active: #e7f7d3;
    --color-sidebar-hover: #d4f0c6;
    --border-radius: 16px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

.opacity-50 {
    opacity: 0.5 !important;
}

body {
    background-color: #f8f9fa;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 24px 16px;
    overflow-x: hidden;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.auth-container .auth-logo img,
.auth-container > .text-center img {
    max-width: 180px;
    width: 100%;
    height: auto;
}

.login-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 28px 24px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid black;
    position: relative;
    overflow: hidden;
}

.login-container h4 {
    font-size: 1.35rem;
    line-height: 1.35;
    word-wrap: break-word;
}

.login-container .btn-primary {
    background-color: #28a745;
    border: none;
}

.login-container .btn-primary:hover {
    background-color: #218838;
}

.login-container .container,
.login-container .form-forgotcode,
.login-container .container-forgotcode,
.login-container .card-body {
    width: 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    margin: 0;
}

.input-group-text {
    background-color: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

.text-grey {
    color: var(--color-text-secondary) !important;
    font-weight: bold !important;
    font-size: small;
}

.input-group {
    flex-wrap: nowrap;
    width: 100%;
}

.input-group .form-control {
    padding-right: 2.5rem;
    width: 100%;
    min-width: 0;
}

.btn-outline-secondary {
    color: #218838;
    border-color: #218838;
}

.title-forgot {
    font-size: 1.35rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 1rem;
    white-space: normal;
    line-height: 1.35;
    word-wrap: break-word;
}

.form-label {
    font-weight: 300;
    color: #666;
}

.form-control,
.btn {
    height: 48px;
    border-radius: 8px;
}

.form-control {
    width: 100%;
    max-width: 100%;
}

.password-toggle {
    background: none;
    border: none;
    outline: none;
    box-shadow: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:focus {
    outline: none;
    box-shadow: none;
}

.btn.position-absolute {
    background: none;
    border: none;
    outline: none;
    box-shadow: none;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn.position-absolute:focus {
    outline: none !important;
    box-shadow: none !important;
}

.auth-actions {
    display: flex;
    gap: 12px;
}

.auth-actions .btn {
    flex: 1;
    text-align: center;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border-radius: 8px;
}

.d-flex.justify-content-between {
    gap: 12px;
}

.d-flex.justify-content-between button,
.d-flex.justify-content-between a {
    flex: 1;
    text-align: center;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border-radius: 8px;
}

.alert {
    font-size: 0.9rem;
    border-radius: 8px;
    word-wrap: break-word;
}

.resend-link {
    font-weight: 600;
    color: #218838;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.resend-link.disabled {
    color: #adb5bd !important;
    pointer-events: none;
    opacity: 0.6;
    text-decoration: none;
}

.link-back {
    display: inline-block;
    margin-top: 1rem;
    color: #000000;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

.link-back:hover {
    text-decoration: underline;
    font-weight: 600;
}

/* Honeypot : hors écran sans provoquer de scroll horizontal */
.hp-fields {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 575.98px) {
    body {
        align-items: flex-start;
        padding: 20px 12px;
    }

    .auth-container .auth-logo img,
    .auth-container > .text-center img {
        max-width: 140px;
    }

    .login-container {
        padding: 20px 16px;
    }

    .login-container h4 {
        font-size: 1.15rem;
    }

    .title-forgot {
        font-size: 1.15rem;
    }

    .auth-actions,
    .d-flex.justify-content-between {
        flex-direction: column;
    }

    .auth-actions .btn,
    .d-flex.justify-content-between button,
    .d-flex.justify-content-between a {
        width: 100%;
        flex: none;
    }
}

@media (max-width: 360px) {
    .login-container {
        padding: 16px 12px;
    }

    .form-control,
    .btn,
    .auth-actions .btn,
    .d-flex.justify-content-between button,
    .d-flex.justify-content-between a {
        height: 44px;
        font-size: 0.95rem;
    }
}
