/* Variables */
:root {
    --primary: #0D7D62;
    --primary-hover: #0A6550;
    --secondary: #FAAF3B;
    --accent: #8B5CF6;
    --text-dark: #2D3748;
    --text-light: #718096;
    --border-color: #E2E8F0;
    --bg-light: #F7FAFC;
}

/* Animated Background */
body {
    min-height: 100vh;
    background-image: url('../img/image.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    animation: gradient 15s ease infinite;
    display: flex;
    flex-direction: column;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.1;
    z-index: 0;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.auth-container {
    position: relative;
    z-index: 1;
}

/* Login Container */
.login-box {
    width: 100%;
    max-width: 400px;
    margin: 7% auto;
}

/* Card Styling */
.card {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 15px;
    background: white;
}

.card-outline.card-primary {
    border-top: 3px solid var(--primary);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.card-header a.h1 {
    color: var(--text-dark);
    font-size: 1.75rem;
    text-decoration: none;
    font-weight: 600;
}

.card-header a.h1 b {
    color: var(--primary);
}

.card-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Form Elements */
.form-header {
    text-align: center;
    margin-bottom: 1.5rem;
    width: 100%;
}

.form-header h5 {
    color: var(--text-dark);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-header p {
    color: var(--text-light);
    margin-bottom: 0;
}

.input-group {
    margin-bottom: 1rem;
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
}

.input-group-text {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 35px !important;
    background: transparent;
    border: none;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
}

.form-control {
    height: 20px !important;
    padding: 0.375rem 0.75rem;
    padding-left: 35px;
    padding-right: 35px;
    border-radius: 6px !important;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    width: 100%;
    min-width: 280px;
}

/* Password Toggle Button */
.password-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    padding: 0;
    transition: color 0.2s ease;
}

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

/* Checkbox */
.icheck-primary {
    margin-top: 8px;
}

.icheck-primary input[type="checkbox"] {
    margin-right: 6px;
}

.icheck-primary label {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    height: 35px;
    padding: 0 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    width: 100%;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Links */
.text-center a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    cursor: pointer;
}

.text-center a:hover {
    color: var(--primary-hover);
}

/* Back Button */
.btn-back {
    background: none;
    border: none;
    color: var(--text-light);
    padding: 0;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-back:hover {
    color: var(--primary);
}

/* Form Transitions */
.auth-form {
    display: none;
    width: 100%;
    max-width: 320px;
}

#loginForm {
    display: block;
}

/* Responsive Adjustments */
@media (max-width: 576px) {
    .login-box {
        margin: 5% auto;
        padding: 0 1rem;
    }

    .card-body {
        padding: 1.5rem;
    }
}

.login-page,
.register-page {
    align-items: center;
    background: linear-gradient(-45deg, #0D7D62, #FFFFFF, #FF914D);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    display: flex;
    flex-direction: column;
    height: 100vh;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-box,
.register-box {
    width: 400px;
    position: relative;
    z-index: 1;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.card {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 8px !important;
    box-shadow: 0 15px 35px rgba(13, 125, 98, 0.2);
    transition: all 0.3s ease;
    padding: 20px;
    position: relative;
}

.card.card-outline {
    border: 0;
    border-top: 3px solid #0D7D62;
    border-bottom: 3px solid #0D7D62;
}

.card.card-outline.card-primary {
    border-top-color: #0D7D62;
    border-bottom-color: #FF914D;
}

.card:hover {
    box-shadow: 0 20px 40px rgba(13, 125, 98, 0.3);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(13, 125, 98, 0.1);
    border-radius: 8px !important;
    padding: 20px 0;
}

.card-body {
    padding: 30px 20px;
}

.input-group {
    position: relative;
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: 8px;
}

.form-control {
    border-radius: 8px;
    padding: 10px 10px 10px 30px;
    transition: all 0.3s ease;
    border: 1px solid rgba(13, 125, 98, 0.2);
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    height: 45px !important;
    font-size: 14px;
    outline: none;
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
}

.form-control:focus {
    outline: none;
    box-shadow: none;
    border-color: #0D7D62;
    border-width: 1.5px;
}

.input-group-text {
    position: absolute;
    left: 0px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: transparent;
    border: none;
    color: #0D7D62;
    font-size: 16px;
    height: 80px !important;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.input-group-append {
    position: relative;
}

.input-group > .form-control:not(:first-child) {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.btn {
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    width: 100%;
    color: white !important;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(45deg, #0D7D62, #14a185);
    border: none;
    box-shadow: 0 4px 15px rgba(13, 125, 98, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(45deg, #14a185, #1bc4a3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 125, 98, 0.4);
}

.btn-default {
    background: rgba(13, 125, 98, 0.1);
    border: none;
    color: #0D7D62 !important;
}

.btn-default:hover {
    background: rgba(13, 125, 98, 0.2);
}

.auth-form {
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease;
}

.auth-form[style*="display: none"] {
    opacity: 0;
    transform: scale(0.95);
}

a {
    color: #0D7D62;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    color: #FF914D;
    text-decoration: none;
}

.icheck-primary {
    margin-top: 8px;
}

.icheck-primary label {
    font-size: 14px;
    color: #666;
}

.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 15px rgba(13, 125, 98, 0.1);
}

.alert-success {
    background: linear-gradient(45deg, #0D7D62, #14a185);
    color: white;
}

.alert-danger {
    background: linear-gradient(45deg, #FF914D, #ffaa76);
    color: white;
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-header h4 {
    color: #0D7D62;
    margin-bottom: 10px;
    font-weight: 600;
}

.form-header p {
    color: #666;
    font-size: 14px;
}

.btn-back {
    margin-bottom: 20px;
    background: transparent;
    border: 1px solid rgba(13, 125, 98, 0.2);
    color: #0D7D62 !important;
    border-radius: 8px;
}

/* Effet de particules */
.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 10%, transparent 10.5%);
    background-size: 25px 25px;
    animation: moveBackground 20s linear infinite;
    opacity: 0.5;
}

@keyframes moveBackground {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

.login-box:hover,
.register-box:hover {
    transform: translateY(-5px);
}

*:focus {
    outline: none !important;
    box-shadow: none !important;
}
#forgotPasswordForm {
    display: none;
}
.auth-form {
    transition: all 0.3s ease;
}
.btn-back {
    margin-bottom: 15px;
}
.form-header {
    margin-bottom: 25px;
    text-align: center;
}
.form-header h5 {
    color: #444;
    margin-bottom: 10px;
}
.form-header p {
    color: #777;
    font-size: 14px;
}

/* Ajustements pour le formulaire */
form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

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