/* Center card section (shared with waitingRoom.css) */
.center-card-section {
    display: flex;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
.center-card-section .container {
    width: 100%;
}
.center-card-section .hero-figure {
    display: none;
}
@media (min-width: 1025px) {
    .center-card-section .hero-figure {
        display: block;
    }
}

/* Login Card */
.login-card {
    max-width: 552px;
    width: 100%;
    margin: 0 auto;
    padding: 48px;
    background: linear-gradient(160deg, rgba(15, 15, 25, 0.95) 40%, rgba(70, 120, 249, 0.12) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    text-align: center;
}

/* Form section transition */
.login-form-section {
    transition: opacity 0.3s ease;
}

/* Icon */
.login-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: rgba(70, 120, 249, 0.1);
    border: 1px solid rgba(70, 120, 249, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-icon i {
    font-size: 30px;
    color: #4678f9;
}

/* Success variant */
.login-icon-success {
    background: linear-gradient(135deg, rgba(46, 206, 137, 0.2), rgba(46, 206, 137, 0.06)) !important;
    border-color: rgba(46, 206, 137, 0.3) !important;
}
.login-icon-success i {
    color: #2ece89 !important;
}

/* Title */
.login-title {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    letter-spacing: -0.4px;
}

/* Description */
.login-description {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Inline error message */
.login-error {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    border-radius: 10px;
    background: rgba(255, 75, 75, 0.1);
    border: 1px solid rgba(255, 75, 75, 0.25);
    color: #ff6b6b;
    font-size: 13px;
    text-align: left;
    animation: fadeIn 0.3s ease;
}
.login-error.show {
    display: flex;
}
.login-error i {
    flex-shrink: 0;
    font-size: 14px;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input group with icon */
.login-input-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0 16px;
    margin-bottom: 16px;
    transition:
        border-color 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}
.login-input-group:focus-within {
    border-color: rgba(70, 120, 249, 0.4);
    background: rgba(70, 120, 249, 0.04);
}
.login-input-group:focus-within > i:first-child {
    color: #4678f9;
}
.login-input-group > i:first-child {
    color: rgba(255, 255, 255, 0.35);
    font-size: 15px;
    margin-right: 12px;
    flex-shrink: 0;
    transition: color 0.25s ease;
}
.login-input-group .form-input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #fff;
    padding: 14px 0;
    font-size: 15px;
    outline: none;
    text-align: left;
}
.login-input-group .form-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Validation error state */
.login-input-group.input-error {
    border-color: rgba(255, 75, 75, 0.5);
    background: rgba(255, 75, 75, 0.06);
    animation: inputShake 0.4s ease;
}
.login-input-group.input-error > i:first-child {
    color: #ff4b4b;
}

@keyframes inputShake {
    0%,
    100% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-6px);
    }
    40% {
        transform: translateX(6px);
    }
    60% {
        transform: translateX(-4px);
    }
    80% {
        transform: translateX(4px);
    }
}

/* Custom select styling */
.login-input-group select.form-input {
    appearance: none;
    -webkit-appearance: none;
    background: transparent
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff50' d='M6 8L1 3h10z'/%3E%3C/svg%3E")
        no-repeat right 4px center;
    padding-right: 24px;
    cursor: pointer;
    color: #fff;
}
.login-input-group select.form-input option {
    background: #1a1a2e;
    color: #fff;
}

/* Focus indicators for accessibility */
.login-btn:focus-visible,
.join-room-btn:focus-visible,
.random-room-btn:focus-visible,
.password-toggle:focus-visible {
    outline: 2px solid #4678f9;
    outline-offset: 2px;
}
.login-input-group:focus-within {
    box-shadow: 0 0 0 2px rgba(70, 120, 249, 0.15);
}

/* Password toggle button */
.password-toggle {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 4px 0 4px 8px;
    font-size: 14px;
    line-height: 1;
    transition: color 0.2s ease;
    flex-shrink: 0;
}
.password-toggle:hover {
    color: rgba(255, 255, 255, 0.6);
}

/* Login button */
.login-btn {
    width: 100%;
    padding: 15px;
    margin-top: 10px;
    margin-bottom: 0;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #4678f9, #3b5de7);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        opacity 0.15s ease;
}
.login-btn:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(70, 120, 249, 0.3);
}
.login-btn:active:not(:disabled) {
    box-shadow: 0 2px 8px rgba(70, 120, 249, 0.15);
}
.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Login button loader */
.login-btn-loader {
    display: none;
    align-items: center;
    gap: 6px;
}
.login-btn-loader.show {
    display: inline-flex;
}

/* Join Room form background */
#joinRoomForm {
    display: none;
    background: linear-gradient(160deg, rgba(15, 15, 25, 0.95) 40%, rgba(70, 120, 249, 0.12) 100%);
    border-radius: 20px;
    padding: 48px;
    margin: -48px;
}
#joinRoomForm.show {
    display: block;
}

#selectRoom {
    background: transparent;
    border: none;
}

/* Join Room title */
.join-room-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Room input row: input + random button side by side */
.room-input-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 16px;
}
.room-input-row .login-input-group {
    flex: 1;
    margin-bottom: 0;
}

/* Random room button */
.random-room-btn {
    width: 52px;
    min-width: 52px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        border-color 0.2s ease,
        color 0.2s ease,
        background 0.2s ease;
}
.random-room-btn:hover {
    border-color: rgba(70, 120, 249, 0.35);
    color: #4678f9;
    background: rgba(70, 120, 249, 0.06);
}
.random-room-btn:active {
    transform: scale(0.95);
}

/* Join room button */
.join-room-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #2ece89, #27b578);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}
.join-room-btn:hover {
    box-shadow: 0 4px 16px rgba(46, 206, 137, 0.3);
}
.join-room-btn:active {
    box-shadow: 0 2px 8px rgba(46, 206, 137, 0.15);
}

/* Responsive */
@media (min-width: 641px) {
    .login-card {
        min-width: 420px;
    }
}
@media (min-width: 1025px) {
    .login-card {
        margin: 0;
    }
}
@media (max-width: 640px) {
    .login-card {
        margin: 0 16px;
        padding: 44px 28px 36px;
    }
    .login-title,
    .join-room-title {
        font-size: 22px;
    }
    .login-icon {
        width: 60px;
        height: 60px;
    }
    .login-icon i {
        font-size: 26px;
    }
}
