/* ================================================
   GLOBAL CONFLICT - LOGIN FINAL
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;600;700;800;900&display=swap');

:root {
    --military-dark: #0f1115;
    --anthracite: #1a1d23;
    --anthracite-light: #2a2e35;
    --sand: #c4a572;
    --sand-light: #d9c9a3;
    --sand-dark: #a08557;
    --green: #6b8e4e;
    --red: #b85450;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: linear-gradient(135deg, rgba(15, 17, 21, 0.9) 0%, rgba(26, 29, 35, 0.9) 100%),
                url('vue-de-devant-des-soldats-combattant-pendant-la-guerre.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ===== LOADING ===== */
.loading-circle {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 17, 21, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    gap: 2rem;
}

.loading-circle.active {
    display: flex;
}

.spinner {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    position: relative;
    animation: spin 3s linear infinite;
}

.spinner::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        var(--sand-dark) 45deg,
        var(--sand) 90deg,
        var(--sand-light) 135deg,
        var(--sand) 180deg,
        var(--sand-dark) 225deg,
        transparent 270deg,
        transparent 360deg
    );
    mask: radial-gradient(circle, transparent 70%, black 70%);
    -webkit-mask: radial-gradient(circle, transparent 70%, black 70%);
    animation: spin 2s linear infinite reverse;
}

.spinner::after {
    content: '';
    position: absolute;
    inset: 20px;
    border-radius: 50%;
    border: 3px solid var(--sand-dark);
    box-shadow: 
        0 0 40px var(--sand),
        inset 0 0 40px rgba(196, 165, 114, 0.3);
}

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

.loading-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sand-light);
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ===== CONTAINER ===== */
.login-container {
    width: 100%;
    max-width: 1320px;
    height: 715px;
    padding: 2rem;
    perspective: 2000px;
}

.login-box {
    width: 100%;
    height: 100%;
    background: rgba(26, 29, 35, 0.95);
    border: 3px solid var(--sand-dark);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.8),
        0 0 100px rgba(196, 165, 114, 0.3);
    display: flex;
    flex-direction: column;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    border-bottom: 3px solid var(--sand-dark);
    background: rgba(15, 17, 21, 0.8);
}

.tab {
    flex: 1;
    padding: 1.5rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Rajdhani', sans-serif;
    position: relative;
}

.tab:hover {
    color: var(--sand-light);
    background: rgba(196, 165, 114, 0.1);
}

.tab.active {
    color: var(--sand-light);
    background: rgba(196, 165, 114, 0.2);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--sand), var(--sand-light));
    box-shadow: 0 0 15px var(--sand);
}

/* ===== CONTENT WRAPPER (qui tourne) ===== */
.content-wrapper {
    flex: 1;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.content-wrapper.flipped {
    transform: rotateY(180deg);
}

/* ===== VIEWS ===== */
.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    backface-visibility: hidden;
}

.login-view {
    transform: rotateY(0deg);
}

.signup-view {
    transform: rotateY(180deg);
}

/* ===== PANELS ===== */
.form-panel {
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(26, 29, 35, 0.95);
}

.image-panel {
    background: linear-gradient(135deg, var(--anthracite) 0%, var(--anthracite-light) 100%);
    position: relative;
    overflow: hidden;
}

.image-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(45deg, transparent 40%, rgba(196, 165, 114, 0.1) 50%, transparent 60%),
        linear-gradient(-45deg, transparent 40%, rgba(196, 165, 114, 0.1) 50%, transparent 60%);
    background-size: 200% 200%;
    animation: shimmer 3s ease-in-out infinite;
}

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

.image-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 40px rgba(196, 165, 114, 0.5));
}

.form-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--sand-light);
    text-transform: uppercase;
    letter-spacing: 5px;
    margin-bottom: 0.5rem;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.form-subtitle {
    font-size: 1.1rem;
    color: var(--sand);
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

/* ===== INPUTS ===== */
.input-group {
    margin-bottom: 1.3rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--sand);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.4rem;
}

.input-group input {
    width: 100%;
    padding: 0.9rem 1rem;
    background: rgba(15, 17, 21, 0.8) !important;
    border: 2px solid var(--sand-dark);
    border-radius: 8px;
    color: white !important;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Rajdhani', sans-serif;
    transition: all 0.3s;
}

/* Forcer le style même avec autocomplete du navigateur */
.input-group input:-webkit-autofill,
.input-group input:-webkit-autofill:hover,
.input-group input:-webkit-autofill:focus,
.input-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(15, 17, 21, 0.8) inset !important;
    -webkit-text-fill-color: white !important;
    box-shadow: 0 0 0 30px rgba(15, 17, 21, 0.8) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--sand);
    background: rgba(15, 17, 21, 1);
    box-shadow: 0 0 20px rgba(196, 165, 114, 0.4);
}

/* ===== BOUTONS ===== */
.btn {
    width: 100%;
    padding: 1.1rem;
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: all 0.3s;
    font-family: 'Rajdhani', sans-serif;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 400px;
    height: 400px;
}

.btn-green {
    background: linear-gradient(135deg, var(--green), #5d6b3b);
    color: black;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(107, 142, 78, 0.6);
}

.btn-green:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 35px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(107, 142, 78, 0.8);
}

.btn-red {
    background: linear-gradient(135deg, var(--red), #8b4340);
    color: black;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(184, 84, 80, 0.6);
}

.btn-red:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 35px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(184, 84, 80, 0.8);
}

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

/* ===== MUSIC PLAYER ===== */
.music-player {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: rgba(26, 29, 35, 0.95);
    border: 2px solid var(--sand-dark);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 20px rgba(196, 165, 114, 0.15);
    min-width: 220px;
}

.music-icon {
    font-size: 1.2rem;
    color: var(--sand);
    animation: musicPulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes musicPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

.music-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.music-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--sand-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-volume {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--anthracite-light);
    outline: none;
    cursor: pointer;
}

.music-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--sand);
    cursor: pointer;
    box-shadow: 0 0 6px rgba(196, 165, 114, 0.6);
}

.music-playpause {
    background: rgba(196, 165, 114, 0.15);
    border: 1px solid var(--sand-dark);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    color: var(--sand-light);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    font-family: monospace;
}

.music-playpause:hover {
    background: rgba(196, 165, 114, 0.3);
    box-shadow: 0 0 10px rgba(196, 165, 114, 0.4);
}

.music-next {
    background: transparent;
    border: none;
    color: var(--sand-dark);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
    font-family: monospace;
}

.music-next:hover {
    color: var(--sand-light);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .view {
        grid-template-columns: 1fr;
    }
    
    .image-panel {
        display: none;
    }
}
